diff --git a/govcd/tm_provider_gateway.go b/govcd/tm_provider_gateway.go index c4471db4e..66b8a4590 100644 --- a/govcd/tm_provider_gateway.go +++ b/govcd/tm_provider_gateway.go @@ -7,28 +7,6 @@ import ( "github.com/vmware/go-vcloud-director/v3/types/v56" ) -// This is a template of how a "standard" outer entity implementation can be done when using generic -// functions. It might not cover all scenarios, but is a skeleton for quicker bootstraping of a new -// entity. -// -// "Search and replace the following entries" -// -// TmProviderGateway - outer type (e.g. IpSpace2) -// This should be a non existing new type to create in 'govcd' package -// -// types.TmProviderGateway - inner type (e.g. types.IpSpace) -// This should be an already existing inner type in `types` package -// -// TM Provider Gateway - constant name for entity label (the lower case prefix 'label' prefix is hardcoded) -// The 'label' prefix is hardcoded in the example so that we have autocompletion working for all labelXXXX. (e.g. IpSpace2) -// -// TM Provider Gateway - text for entity label (e.g. Ip Space 2) -// This will be the entity label (used for logging purposes in generic functions) -// -// types.OpenApiPathVcf + types.OpenApiEndpointTmProviderGateways (e.g. types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointIpSpaces) -// An OpenAPI endpoint that is defined in `endpointMinApiVersions` map and in `constants.go` -// NOTE. While this example REPLACES ALL ENDPOINTS to be THE SAME, in reality they can be DIFFERENT - const labelTmProviderGateway = "TM Provider Gateway" type TmProviderGateway struct { diff --git a/govcd/tm_provider_gateway_test.go b/govcd/tm_provider_gateway_test.go index f2b0f82a7..e0ac6e78d 100644 --- a/govcd/tm_provider_gateway_test.go +++ b/govcd/tm_provider_gateway_test.go @@ -49,9 +49,9 @@ func (vcd *TestVCD) Test_TmProviderGateway(check *C) { Name: check.TestName(), Description: check.TestName(), BackingType: "NSX_TIER0", - BackingRef: &types.OpenApiReference{ID: t0ByNameInRegion.TmTier0Gateway.ID}, - RegionRef: &types.OpenApiReference{ID: region.Region.ID}, - IPSpaceRefs: []*types.OpenApiReference{{ + BackingRef: types.OpenApiReference{ID: t0ByNameInRegion.TmTier0Gateway.ID}, + RegionRef: types.OpenApiReference{ID: region.Region.ID}, + IPSpaceRefs: []types.OpenApiReference{{ ID: ipSpace.TmIpSpace.ID, }}, } @@ -60,24 +60,3 @@ func (vcd *TestVCD) Test_TmProviderGateway(check *C) { panic(err) } - -// { -// "name": "test-provider-gw", -// "description": "", -// "orgRef": null, -// "backingRef": { -// "id": "37273049-ecda-4974-baf6-5c107f30a969", -// "name": "vcfcons-mgt-vc03-Tier0" -// }, -// "backingType": "NSX_TIER0", -// "regionRef": { -// "id": "urn:vcloud:region:7544b246-84c6-40ad-8c3b-beed9fe145cd", -// "name": "Terraform demo Region" -// }, -// "ipSpaceRefs": [ -// { -// "id": "urn:vcloud:ipSpace:feb3d26d-08e7-4e3f-90cc-f54f13a45697", -// "name": "demo-ip-space" -// } -// ] -// } diff --git a/govcd/tm_tier0_gateway.go b/govcd/tm_tier0_gateway.go index 9a0cac27d..8bbdc2009 100644 --- a/govcd/tm_tier0_gateway.go +++ b/govcd/tm_tier0_gateway.go @@ -7,10 +7,6 @@ import ( "github.com/vmware/go-vcloud-director/v3/types/v56" ) -// Sample query -// https://vcfa.10.162.145.191.vcfd.broadcom.net/tm/cloudapi/1.0.0/nsxTResources/importableTier0Routers -// ?page=1&pageSize=128&filterEncoded=true&filter=(alreadyImported==false;_context==urn:vcloud:region:7544b246-84c6-40ad-8c3b-beed9fe145cd)&links=true - const labelTmTier0Gateway = "TM Tier0 Gateway" type TmTier0Gateway struct { diff --git a/types/v56/tm.go b/types/v56/tm.go index 991adf6f0..e5105f6ed 100644 --- a/types/v56/tm.go +++ b/types/v56/tm.go @@ -362,12 +362,12 @@ type TmTier0Gateway struct { } type TmProviderGateway struct { - ID string `json:"id,omitempty"` - Name string `json:"name"` - Description string `json:"description,omitempty"` - OrgRef *OpenApiReference `json:"orgRef,omitempty"` - BackingRef *OpenApiReference `json:"backingRef,omitempty"` - BackingType string `json:"backingType,omitempty"` - RegionRef *OpenApiReference `json:"regionRef,omitempty"` - IPSpaceRefs []*OpenApiReference `json:"ipSpaceRefs,omitempty"` + ID string `json:"id,omitempty"` + Name string `json:"name"` + Description string `json:"description,omitempty"` + OrgRef *OpenApiReference `json:"orgRef,omitempty"` + BackingRef OpenApiReference `json:"backingRef,omitempty"` + BackingType string `json:"backingType,omitempty"` + RegionRef OpenApiReference `json:"regionRef,omitempty"` + IPSpaceRefs []OpenApiReference `json:"ipSpaceRefs,omitempty"` }