Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: abarreiro <abarreiro@vmware.com>
  • Loading branch information
adambarreiro committed Jun 20, 2024
1 parent 05ce5ba commit 393469b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions govcd/vdc_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func genericVdcTemplateRequest(client *Client, input types.VMWVdcTemplate, href
result := &types.VMWVdcTemplate{}

resp, err := client.executeJsonRequest(href.String(), method, input, "error when performing a "+method+" for VDC Template: %s")
defer closeBody(resp)
if err != nil {
return nil, err
}
defer closeBody(resp)

vdcTemplate := VdcTemplate{
VdcTemplate: result,
Expand All @@ -68,14 +68,13 @@ func (vcdClient *VCDClient) GetVdcTemplateById(id string) (*VdcTemplate, error)

result := &types.VMWVdcTemplate{}
resp, err := vcdClient.Client.executeJsonRequest(href.String(), http.MethodGet, nil, "error getting VDC Template: %s")
defer closeBody(resp)

if err != nil {
if strings.Contains(err.Error(), "RESOURCE_NOT_FOUND") || strings.Contains(err.Error(), "not exist") {
return nil, fmt.Errorf("%s: %s", ErrorEntityNotFound, err)
}
return nil, err
}
defer closeBody(resp)

vdcTemplate := VdcTemplate{
VdcTemplate: result,
Expand Down
6 changes: 2 additions & 4 deletions types/v56/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ type VMWVdcTemplateBinding struct {
type VMWVdcTemplateSpecification struct {
Type string `json:"_type,omitempty"`

// Indicates that the Provider VDC's automatically-created VXLAN network pool should be used.
// NetworkPoolReference must be empty if this element appears in the request.
AutomaticNetworkPoolReference *AutomaticNetworkPoolReference `json:"automaticNetworkPoolReference,omitempty"`

// Maximum number of virtual NICs allowed in this VDC. Defaults to 0, which specifies an unlimited number.
Expand All @@ -731,10 +733,6 @@ type VMWVdcTemplateSpecification struct {
// Maximum number of network objects that can be deployed in this VDC. Defaults to 0, which means no networks can be deployed.
ProvisionedNetworkQuota int `json:"provisionedNetworkQuota"`

// Indicates that the Provider VDC's automatically-created VXLAN network pool should be used.
// NetworkPoolReference must be empty if this element appears in the request.
// AutomaticNetworkPoolReference *Reference `xml:"vmext:AutomaticNetworkPoolReference,omitempty"`

// Defines a gateway and NAT Routed organization VDC network to be created.
GatewayConfiguration *VdcTemplateSpecificationGatewayConfiguration `json:"gatewayConfiguration,omitempty"`

Expand Down

0 comments on commit 393469b

Please sign in to comment.