github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/apigw/v2/gateway/EnableIngressAccess.go (about) 1 package gateway 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 ) 7 8 // IngressAccessOpts allows binding and updating the eip associated with an existing APIG dedicated instance with the 9 // given parameters. 10 type IngressAccessOpts struct { 11 // EIP ID 12 EipId string `json:"eip_id,omitempty"` 13 } 14 15 // EnableIngressAccess is a method to bind and update the eip associated with an existing APIG dedicated instance. 16 func EnableIngressAccess(client *golangsdk.ServiceClient, instanceId string, opts IngressAccessOpts) (*GatewayResp, error) { 17 b, err := build.RequestBody(opts, "") 18 if err != nil { 19 return nil, err 20 } 21 var r GatewayResp 22 _, err = client.Post(client.ServiceURL("apigw", "instances", instanceId, "eip"), b, &r, &golangsdk.RequestOpts{}) 23 return &r, err 24 }