
Create a new virtual private endpoint gateway - go
Create a new virtual private endpoint gateway.
(mqcloud *MqcloudV1) CreateVirtualPrivateEndpointGateway(createVirtualPrivateEndpointGatewayOptions *CreateVirtualPrivateEndpointGatewayOptions) (result *VirtualPrivateEndpointGatewayDetails, response *core.DetailedResponse, err error)
(mqcloud *MqcloudV1) CreateVirtualPrivateEndpointGatewayWithContext(ctx context.Context, createVirtualPrivateEndpointGatewayOptions *CreateVirtualPrivateEndpointGatewayOptions) (result *VirtualPrivateEndpointGatewayDetails, response *core.DetailedResponse, err error)
Request
Instantiate the CreateVirtualPrivateEndpointGatewayOptions struct and set the
fields to provide parameter values for the CreateVirtualPrivateEndpointGateway
method.
| parameter | WithContext method only |
|---|---|
ctxContext
|
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request. |
| CreateTrustStorePemCertificateOptions | The CreateTrustStorePemCertificate options. |
|---|---|
ServiceInstanceGuidRequired*
string |
The GUID that uniquely identifies the IBM® MQ as a Service instance. Possible values: length = 36, Value must match regular expression
Example: |
NameRequired*
string |
The name of the virtual private endpoint gateway - conforming to naming rules. Possible values: 1 ≤ length ≤ 63, Value must match regular expression
|
TargetCrnRequired*
string |
The CRN of the target reserved capacity service instance or private path service. Possible values: 9 ≤ length ≤ 512, Value must match regular expression
crn:v1:bluemix:public:mqcloud:eu-de:::endpoint:qm1.private.eu-de.mq2.test.appdomain.cloud |
TrustedProfileString
|
The CRN of the trusted profile to assume for this request. This can only be retrieved
using the CLI using Possible
values: 9 ≤ length ≤ 512, Value must match regular expression
crn:v1:bluemix:public:iam-identity::a/5d5ff2a9001c4055ab1408e9bf185f48::profile:Profile-1c0a8609-ca25-4ad2-a09b-aea472d34afc |
Example request
createVirtualPrivateEndpointGatewayOptions := mqcloudService.NewCreateVirtualPrivateEndpointGatewayOptions(
"a2b4d4bc-dadb-4637-bcec-9b7d1e723af8",
"vpe-gateway1-to-vpe-gateway",
"crn:v1:bluemix:public:mqcloud:eu-de:::endpoint:qm1.private.eu-de.mq2.test.appdomain.cloud",
)
createVirtualPrivateEndpointGatewayOptions.SetTrustedProfile("crn:v1:bluemix:public:iam-identity::a/5d5ff2a9001c4055ab1408e9bf185f48::profile:Profile-1c0a8609-ca25-4ad2-a09b-aea472d34afc")
virtualPrivateEndpointGatewayDetails, response, err := mqcloudService.CreateVirtualPrivateEndpointGateway(createVirtualPrivateEndpointGatewayOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(virtualPrivateEndpointGatewayDetails, "", " ")
fmt.Println(string(b))
Response
| VirtualPrivateEndpointGatewayDetails | The details of a specific Virtual Private Endpoint Gateway |
|---|---|
HrefAlways included*
string |
URL for the details of the virtual private endpoint gateway. Possible values: 10 ≤ length ≤ 8000, Value must match regular expression
|
IDAlways included*
string |
The ID of the virtual private endpoint gateway which was allocated on creation. Possible values: length = 41, Value must match regular expression
|
NameAlways included*
string |
The name of the virtual private endpoint gateway, created by the user. Possible values: 1 ≤ length ≤ 63, Value must match regular expression
|
TargetCrn
Always included*
string |
The CRN of the virtual private endpoint gateway the user is trying to connect to. Possible values: 9 ≤ length ≤ 512, Value must match regular expression
|
StatusAlways included*
string |
The lifecycle state of this virtual privage endpoint. Possible values: 2 ≤ length ≤ 12, Value must match regular expression
|
| Status code | |
|---|---|
| 201 | An object containing details of the uploaded trust store certificate |
| 301 | URI has permanently Moved |
| 400 | Bad Request |
| 401 | Unauthorized |
| 409 | Conflict |
| 429 | Service Is Overused |
| 500 | Internal Server Error |
| 503 | Service Unavailable Error |
Example response
Success example
{
"href": "https://api.private.eu-de.mq2.cloud.ibm.com/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/virtual_private_endpoint_gateway/r010-ebab3c08-c9a8-40c4-8869-61c09ddf7b44",
"id": "r010-ebab3c08-c9a8-40c4-8869-61c09ddf7b44",
"name": "vpe-gateway1-to-vpe-gateway",
"target_crn": "crn:v1:bluemix:public:mqcloud:eu-de:a/account-id:reserved-capacity-guid::",
"status": "approved"
}