From c1005ac6453626ac620b0fc1ebe44d236812a19e Mon Sep 17 00:00:00 2001 From: SunithaGudisagar Date: Mon, 4 Mar 2024 14:08:07 +0530 Subject: [PATCH] SDK update --- .../github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go | 4468 ++++++++++++----- go.mod | 2 +- .../resource_ibm_iam_user_policy_test.go | 2 - 3 files changed, 3332 insertions(+), 1140 deletions(-) diff --git a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go index f77c405d22..9ff7022452 100644 --- a/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/common/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021, 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2023, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553 + * IBM OpenAPI SDK Code Generator Version: 3.84.0-a4533f12-20240103-170852 */ // Package vpcv1 : Operations and models for the VpcV1 service @@ -38,7 +38,7 @@ import ( // VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual // server instances, along with subnets, volumes, load balancers, and more. // -// API Version: 2023-12-20 +// API Version: 2024-01-24 const ( YYYYMMDD = "2006-01-02" ) @@ -51,7 +51,7 @@ type VpcV1 struct { generation *int64 // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-12-05` - // and `2023-12-20`. + // and `2024-01-29`. Version *string } @@ -68,7 +68,7 @@ type VpcV1Options struct { Authenticator core.Authenticator // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2023-12-05` - // and `2023-12-20`. + // and `2024-01-29`. Version *string } @@ -3266,7 +3266,7 @@ func (vpc *VpcV1) GetSubnetRoutingTableWithContext(ctx context.Context, getSubne // This request replaces the existing routing table for a subnet with the routing table specified in the request body. // // For this request to succeed, the routing table `route_direct_link_ingress`, -// `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. +// `route_internet_ingress`, `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. func (vpc *VpcV1) ReplaceSubnetRoutingTable(replaceSubnetRoutingTableOptions *ReplaceSubnetRoutingTableOptions) (result *RoutingTable, response *core.DetailedResponse, err error) { return vpc.ReplaceSubnetRoutingTableWithContext(context.Background(), replaceSubnetRoutingTableOptions) } @@ -5440,6 +5440,15 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt if listInstancesOptions.PlacementGroupName != nil { builder.AddQuery("placement_group.name", fmt.Sprint(*listInstancesOptions.PlacementGroupName)) } + if listInstancesOptions.ReservationID != nil { + builder.AddQuery("reservation.id", fmt.Sprint(*listInstancesOptions.ReservationID)) + } + if listInstancesOptions.ReservationCRN != nil { + builder.AddQuery("reservation.crn", fmt.Sprint(*listInstancesOptions.ReservationCRN)) + } + if listInstancesOptions.ReservationName != nil { + builder.AddQuery("reservation.name", fmt.Sprint(*listInstancesOptions.ReservationName)) + } request, err := builder.Build() if err != nil { @@ -5570,6 +5579,9 @@ func (vpc *VpcV1) DeleteInstanceWithContext(ctx context.Context, deleteInstanceO for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + if deleteInstanceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteInstanceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -5687,6 +5699,9 @@ func (vpc *VpcV1) UpdateInstanceWithContext(ctx context.Context, updateInstanceO } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateInstanceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateInstanceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) @@ -6480,8 +6495,8 @@ func (vpc *VpcV1) UpdateInstanceNetworkAttachmentWithContext(ctx context.Context // the instance may also attach to the same subnet. // // If this instance has network attachments, each returned network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface. func (vpc *VpcV1) ListInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions *ListInstanceNetworkInterfacesOptions) (result *NetworkInterfaceUnpaginatedCollection, response *core.DetailedResponse, err error) { return vpc.ListInstanceNetworkInterfacesWithContext(context.Background(), listInstanceNetworkInterfacesOptions) } @@ -6550,8 +6565,8 @@ func (vpc *VpcV1) ListInstanceNetworkInterfacesWithContext(ctx context.Context, // specified. Addresses on the instance network interface must be within the specified subnet's CIDR blocks. // // If this instance has network attachments, each network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface, and new network interfaces are not allowed to be created. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and new network interfaces are not allowed to be created. func (vpc *VpcV1) CreateInstanceNetworkInterface(createInstanceNetworkInterfaceOptions *CreateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { return vpc.CreateInstanceNetworkInterfaceWithContext(context.Background(), createInstanceNetworkInterfaceOptions) } @@ -6642,8 +6657,8 @@ func (vpc *VpcV1) CreateInstanceNetworkInterfaceWithContext(ctx context.Context, // not allowed to be deleted. // // If this instance has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface, and is not allowed to be deleted. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be deleted. func (vpc *VpcV1) DeleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions *DeleteInstanceNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { return vpc.DeleteInstanceNetworkInterfaceWithContext(context.Background(), deleteInstanceNetworkInterfaceOptions) } @@ -6698,8 +6713,8 @@ func (vpc *VpcV1) DeleteInstanceNetworkInterfaceWithContext(ctx context.Context, // This request retrieves a single instance network interface specified by the identifier in the URL. // // If this instance has network attachments, the retrieved network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface. func (vpc *VpcV1) GetInstanceNetworkInterface(getInstanceNetworkInterfaceOptions *GetInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { return vpc.GetInstanceNetworkInterfaceWithContext(context.Background(), getInstanceNetworkInterfaceOptions) } @@ -6768,8 +6783,8 @@ func (vpc *VpcV1) GetInstanceNetworkInterfaceWithContext(ctx context.Context, ge // network interface and needs to contain only the information to be updated. // // If this instance has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface, and is not allowed to be updated. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be updated. func (vpc *VpcV1) UpdateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions *UpdateInstanceNetworkInterfaceOptions) (result *NetworkInterface, response *core.DetailedResponse, err error) { return vpc.UpdateInstanceNetworkInterfaceWithContext(context.Background(), updateInstanceNetworkInterfaceOptions) } @@ -9241,6 +9256,416 @@ func (vpc *VpcV1) UpdateInstanceGroupMembershipWithContext(ctx context.Context, return } +// ListReservations : List all reservations +// This request lists all reservations in the region. A reservation provides reserved capacity for a specified profile +// in a specified zone. A reservation can also include a long-term committed use discount. +// +// The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations +// with identical `created_at` property values will in turn be sorted by ascending `name` property values. +func (vpc *VpcV1) ListReservations(listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { + return vpc.ListReservationsWithContext(context.Background(), listReservationsOptions) +} + +// ListReservationsWithContext is an alternate form of the ListReservations method which supports a Context parameter +func (vpc *VpcV1) ListReservationsWithContext(ctx context.Context, listReservationsOptions *ListReservationsOptions) (result *ReservationCollection, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listReservationsOptions, "listReservationsOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) + if err != nil { + return + } + + for headerName, headerValue := range listReservationsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListReservations") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + if listReservationsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listReservationsOptions.Start)) + } + if listReservationsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listReservationsOptions.Limit)) + } + if listReservationsOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listReservationsOptions.Name)) + } + if listReservationsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group.id", fmt.Sprint(*listReservationsOptions.ResourceGroupID)) + } + if listReservationsOptions.ZoneName != nil { + builder.AddQuery("zone.name", fmt.Sprint(*listReservationsOptions.ZoneName)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservationCollection) + if err != nil { + return + } + response.Result = result + } + + return +} + +// CreateReservation : Create a reservation +// This request creates a new reservation from a reservation prototype object. The prototype object is structured in the +// same way as a retrieved reservation, and contains the information necessary to create the new reservation. +func (vpc *VpcV1) CreateReservation(createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.CreateReservationWithContext(context.Background(), createReservationOptions) +} + +// CreateReservationWithContext is an alternate form of the CreateReservation method which supports a Context parameter +func (vpc *VpcV1) CreateReservationWithContext(ctx context.Context, createReservationOptions *CreateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createReservationOptions, "createReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(createReservationOptions, "createReservationOptions") + if err != nil { + return + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations`, nil) + if err != nil { + return + } + + for headerName, headerValue := range createReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + body := make(map[string]interface{}) + if createReservationOptions.Capacity != nil { + body["capacity"] = createReservationOptions.Capacity + } + if createReservationOptions.CommittedUse != nil { + body["committed_use"] = createReservationOptions.CommittedUse + } + if createReservationOptions.Profile != nil { + body["profile"] = createReservationOptions.Profile + } + if createReservationOptions.Zone != nil { + body["zone"] = createReservationOptions.Zone + } + if createReservationOptions.AffinityPolicy != nil { + body["affinity_policy"] = createReservationOptions.AffinityPolicy + } + if createReservationOptions.Name != nil { + body["name"] = createReservationOptions.Name + } + if createReservationOptions.ResourceGroup != nil { + body["resource_group"] = createReservationOptions.ResourceGroup + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// DeleteReservation : Delete a reservation +// This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are +// not allowed to be deleted. +func (vpc *VpcV1) DeleteReservation(deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.DeleteReservationWithContext(context.Background(), deleteReservationOptions) +} + +// DeleteReservationWithContext is an alternate form of the DeleteReservation method which supports a Context parameter +func (vpc *VpcV1) DeleteReservationWithContext(ctx context.Context, deleteReservationOptions *DeleteReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteReservationOptions, "deleteReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(deleteReservationOptions, "deleteReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *deleteReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range deleteReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// GetReservation : Retrieve a reservation +// This request retrieves a single reservation specified by identifier in the URL. +func (vpc *VpcV1) GetReservation(getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.GetReservationWithContext(context.Background(), getReservationOptions) +} + +// GetReservationWithContext is an alternate form of the GetReservation method which supports a Context parameter +func (vpc *VpcV1) GetReservationWithContext(ctx context.Context, getReservationOptions *GetReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getReservationOptions, "getReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getReservationOptions, "getReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *getReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// UpdateReservation : Update a reservation +// This request updates a reservation with the information provided in a reservation patch object. The patch object is +// structured in the same way as a retrieved reservation and needs to contain only the information to be updated. +func (vpc *VpcV1) UpdateReservation(updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + return vpc.UpdateReservationWithContext(context.Background(), updateReservationOptions) +} + +// UpdateReservationWithContext is an alternate form of the UpdateReservation method which supports a Context parameter +func (vpc *VpcV1) UpdateReservationWithContext(ctx context.Context, updateReservationOptions *UpdateReservationOptions) (result *Reservation, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateReservationOptions, "updateReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateReservationOptions, "updateReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *updateReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range updateReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + _, err = builder.SetBodyContentJSON(updateReservationOptions.ReservationPatch) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalReservation) + if err != nil { + return + } + response.Result = result + } + + return +} + +// ActivateReservation : Activate a reservation +// This request activates a reservation. For this request to succeed, the reservation status must be `inactive`. +func (vpc *VpcV1) ActivateReservation(activateReservationOptions *ActivateReservationOptions) (response *core.DetailedResponse, err error) { + return vpc.ActivateReservationWithContext(context.Background(), activateReservationOptions) +} + +// ActivateReservationWithContext is an alternate form of the ActivateReservation method which supports a Context parameter +func (vpc *VpcV1) ActivateReservationWithContext(ctx context.Context, activateReservationOptions *ActivateReservationOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(activateReservationOptions, "activateReservationOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(activateReservationOptions, "activateReservationOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "id": *activateReservationOptions.ID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/reservations/{id}/activate`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range activateReservationOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ActivateReservation") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.generation)) + + request, err := builder.Build() + if err != nil { + return + } + + response, err = vpc.Service.Request(request, nil) + + return +} + // ListDedicatedHostGroups : List all dedicated host groups // This request lists all dedicated host groups in the region. Host groups are a collection of dedicated hosts for // placement of instances. Each dedicated host must belong to one and only one group. Host groups do not span zones. @@ -12309,8 +12734,8 @@ func (vpc *VpcV1) UpdateBareMetalServerNetworkAttachmentWithContext(ctx context. // the bare metal server. // // If this bare metal server has network attachments, each returned network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface. func (vpc *VpcV1) ListBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions *ListBareMetalServerNetworkInterfacesOptions) (result *BareMetalServerNetworkInterfaceCollection, response *core.DetailedResponse, err error) { return vpc.ListBareMetalServerNetworkInterfacesWithContext(context.Background(), listBareMetalServerNetworkInterfacesOptions) } @@ -12386,8 +12811,8 @@ func (vpc *VpcV1) ListBareMetalServerNetworkInterfacesWithContext(ctx context.Co // Addresses on the bare metal server network interface must be within the specified subnet's CIDR blocks. // // If this bare metal server has network attachments, each network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface, and new network interfaces are not allowed to be created. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and new network interfaces are not allowed to be created. func (vpc *VpcV1) CreateBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions *CreateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { return vpc.CreateBareMetalServerNetworkInterfaceWithContext(context.Background(), createBareMetalServerNetworkInterfaceOptions) } @@ -12461,8 +12886,8 @@ func (vpc *VpcV1) CreateBareMetalServerNetworkInterfaceWithContext(ctx context.C // network interface is not allowed to be deleted. // // If this bare metal server has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface, and is not allowed to be deleted. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be deleted. func (vpc *VpcV1) DeleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions *DeleteBareMetalServerNetworkInterfaceOptions) (response *core.DetailedResponse, err error) { return vpc.DeleteBareMetalServerNetworkInterfaceWithContext(context.Background(), deleteBareMetalServerNetworkInterfaceOptions) } @@ -12517,8 +12942,8 @@ func (vpc *VpcV1) DeleteBareMetalServerNetworkInterfaceWithContext(ctx context.C // This request retrieves a single bare metal server network interface specified by the identifier in the URL. // // If this bare metal server has network attachments, the retrieved network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface. func (vpc *VpcV1) GetBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions *GetBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { return vpc.GetBareMetalServerNetworkInterfaceWithContext(context.Background(), getBareMetalServerNetworkInterfaceOptions) } @@ -12587,8 +13012,8 @@ func (vpc *VpcV1) GetBareMetalServerNetworkInterfaceWithContext(ctx context.Cont // a retrieved bare metal server network interface and needs to contain only the information to be updated. // // If this bare metal server has network attachments, this network interface is a [read-only -// representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment and -// its attached virtual network interface, and is not allowed to be updated. +// representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network +// attachment and its attached virtual network interface, and is not allowed to be updated. func (vpc *VpcV1) UpdateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions *UpdateBareMetalServerNetworkInterfaceOptions) (result BareMetalServerNetworkInterfaceIntf, response *core.DetailedResponse, err error) { return vpc.UpdateBareMetalServerNetworkInterfaceWithContext(context.Background(), updateBareMetalServerNetworkInterfaceOptions) } @@ -25551,6 +25976,34 @@ func UnmarshalAccountReference(m map[string]json.RawMessage, result interface{}) return } +// ActivateReservationOptions : The ActivateReservation options. +type ActivateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewActivateReservationOptions : Instantiate ActivateReservationOptions +func (*VpcV1) NewActivateReservationOptions(id string) *ActivateReservationOptions { + return &ActivateReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ActivateReservationOptions) SetID(id string) *ActivateReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ActivateReservationOptions) SetHeaders(param map[string]string) *ActivateReservationOptions { + options.Headers = param + return options +} + // AddBareMetalServerNetworkInterfaceFloatingIPOptions : The AddBareMetalServerNetworkInterfaceFloatingIP options. type AddBareMetalServerNetworkInterfaceFloatingIPOptions struct { // The bare metal server identifier. @@ -27674,8 +28127,8 @@ type BareMetalServer struct { // The network interfaces for this bare metal server, including the primary network interface. // // If this bare metal server has network attachments, each network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface. NetworkInterfaces []NetworkInterfaceBareMetalServerContextReference `json:"network_interfaces" validate:"required"` // The primary network attachment for this bare metal server. @@ -27685,7 +28138,7 @@ type BareMetalServer struct { // // If this bare metal server has network attachments, this primary network interface is // a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) // of the primary network attachment and its attached virtual network interface. PrimaryNetworkInterface *NetworkInterfaceBareMetalServerContextReference `json:"primary_network_interface" validate:"required"` @@ -29095,16 +29548,16 @@ type BareMetalServerNetworkInterface struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` // The date and time that the bare metal server network interface was created. // // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) when its corresponding network attachment - // was created. + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // If `true`: @@ -29118,32 +29571,32 @@ type BareMetalServerNetworkInterface struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` // The floating IPs associated with this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the floating IPs are associated with the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The interface type: @@ -29161,9 +29614,9 @@ type BareMetalServerNetworkInterface struct { // which traffic flows. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the interface type is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the interface type is that of the + // corresponding network attachment. // // The enumerated values for this property are expected to expand in the future. When processing this property, check // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the @@ -29174,24 +29627,25 @@ type BareMetalServerNetworkInterface struct { // will be an empty string. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the MAC address is that of the attached virtual network - // interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. MacAddress *string `json:"mac_address" validate:"required"` // The name for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the name matches its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` // The bare metal server network interface port speed in Mbps. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the port speed is that of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. PortSpeed *int64 `json:"port_speed" validate:"required"` PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` @@ -29202,16 +29656,16 @@ type BareMetalServerNetworkInterface struct { // The security groups targeting this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the security groups are associated with the attached - // virtual network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` // The status of the bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). Status *string `json:"status" validate:"required"` // The associated subnet. @@ -29220,16 +29674,17 @@ type BareMetalServerNetworkInterface struct { // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. Type *string `json:"type" validate:"required"` // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN IDs match the `allow_vlans` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the + // `allow_vlans` of the corresponding network attachment. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for @@ -29244,17 +29699,17 @@ type BareMetalServerNetworkInterface struct { // this network interface's `vlan`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the value of this property matches that of the - // `allow_to_float` property of the corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. Vlan *int64 `json:"vlan,omitempty"` } @@ -29274,9 +29729,9 @@ type BareMetalServerNetworkInterface struct { // which traffic flows. // // If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and the interface type is that of the corresponding network -// attachment. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the interface type is that of the +// corresponding network attachment. // // The enumerated values for this property are expected to expand in the future. When processing this property, check // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the @@ -29298,7 +29753,7 @@ const ( // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( BareMetalServerNetworkInterfaceStatusAvailableConst = "available" BareMetalServerNetworkInterfaceStatusDeletingConst = "deleting" @@ -29310,8 +29765,9 @@ const ( // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( BareMetalServerNetworkInterfaceTypePrimaryConst = "primary" BareMetalServerNetworkInterfaceTypeSecondaryConst = "secondary" @@ -29447,9 +29903,9 @@ type BareMetalServerNetworkInterfacePatch struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The VLAN IDs to allow for `vlan` interfaces using this PCI interface, replacing any existing VLAN IDs. The specified @@ -29467,9 +29923,9 @@ type BareMetalServerNetworkInterfacePatch struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` // The name for this bare metal server network interface. The name must not be used by another network interface on the @@ -29519,9 +29975,9 @@ type BareMetalServerNetworkInterfacePrototype struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // If `true`: @@ -29535,9 +29991,9 @@ type BareMetalServerNetworkInterfacePrototype struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` // The interface type: @@ -29592,17 +30048,17 @@ type BareMetalServerNetworkInterfacePrototype struct { // this network interface's `vlan`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the value of this property matches that of the - // `allow_to_float` property of the corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. Vlan *int64 `json:"vlan,omitempty"` } @@ -29820,17 +30276,17 @@ type BareMetalServerPrimaryNetworkInterfacePrototype struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN IDs match the `allow_vlans` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the + // `allow_vlans` of the corresponding network attachment. AllowedVlans []int64 `json:"allowed_vlans,omitempty"` // If `true`: @@ -29844,9 +30300,9 @@ type BareMetalServerPrimaryNetworkInterfacePrototype struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` // The interface type: @@ -32890,9 +33346,9 @@ type CreateInstanceNetworkInterfaceOptions struct { // Indicates whether source IP spoofing is allowed on this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The name for the instance network interface. The name must not be used by another network interface on the virtual @@ -34241,6 +34697,102 @@ func (options *CreatePublicGatewayOptions) SetHeaders(param map[string]string) * return options } +// CreateReservationOptions : The CreateReservation options. +type CreateReservationOptions struct { + // The capacity reservation configuration to use. + Capacity *ReservationCapacityPrototype `json:"capacity" validate:"required"` + + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePrototype `json:"committed_use" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + Profile *ReservationProfilePrototype `json:"profile" validate:"required"` + + // The zone to use for this reservation. + Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested. + AffinityPolicy *string `json:"affinity_policy,omitempty"` + + // The name for this reservation. The name must not be used by another reservation in the region. If unspecified, the + // name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The resource group to use. If unspecified, the account's [default resource + // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// Constants associated with the CreateReservationOptions.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested. +const ( + CreateReservationOptionsAffinityPolicyRestrictedConst = "restricted" +) + +// NewCreateReservationOptions : Instantiate CreateReservationOptions +func (*VpcV1) NewCreateReservationOptions(capacity *ReservationCapacityPrototype, committedUse *ReservationCommittedUsePrototype, profile *ReservationProfilePrototype, zone ZoneIdentityIntf) *CreateReservationOptions { + return &CreateReservationOptions{ + Capacity: capacity, + CommittedUse: committedUse, + Profile: profile, + Zone: zone, + } +} + +// SetCapacity : Allow user to set Capacity +func (_options *CreateReservationOptions) SetCapacity(capacity *ReservationCapacityPrototype) *CreateReservationOptions { + _options.Capacity = capacity + return _options +} + +// SetCommittedUse : Allow user to set CommittedUse +func (_options *CreateReservationOptions) SetCommittedUse(committedUse *ReservationCommittedUsePrototype) *CreateReservationOptions { + _options.CommittedUse = committedUse + return _options +} + +// SetProfile : Allow user to set Profile +func (_options *CreateReservationOptions) SetProfile(profile *ReservationProfilePrototype) *CreateReservationOptions { + _options.Profile = profile + return _options +} + +// SetZone : Allow user to set Zone +func (_options *CreateReservationOptions) SetZone(zone ZoneIdentityIntf) *CreateReservationOptions { + _options.Zone = zone + return _options +} + +// SetAffinityPolicy : Allow user to set AffinityPolicy +func (_options *CreateReservationOptions) SetAffinityPolicy(affinityPolicy string) *CreateReservationOptions { + _options.AffinityPolicy = core.StringPtr(affinityPolicy) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateReservationOptions) SetName(name string) *CreateReservationOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateReservationOptions) SetResourceGroup(resourceGroup ResourceGroupIdentityIntf) *CreateReservationOptions { + _options.ResourceGroup = resourceGroup + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateReservationOptions) SetHeaders(param map[string]string) *CreateReservationOptions { + options.Headers = param + return options +} + // CreateSecurityGroupOptions : The CreateSecurityGroup options. type CreateSecurityGroupOptions struct { // The VPC this security group will reside in. @@ -35023,8 +35575,13 @@ type CreateVPCRouteOptions struct { // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. Destination *string `json:"destination" validate:"required"` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). + // The zone to apply the route to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. Zone ZoneIdentityIntf `json:"zone" validate:"required"` // The action to perform with a packet matching the route: @@ -35303,8 +35860,13 @@ type CreateVPCRoutingTableRouteOptions struct { // `priority`, and only if both routes have an `action` of `deliver` and the `next_hop` is an IP address. Destination *string `json:"destination" validate:"required"` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). + // The zone to apply the route to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. Zone ZoneIdentityIntf `json:"zone" validate:"required"` // The action to perform with a packet matching the route: @@ -38806,6 +39368,9 @@ type DeleteInstanceOptions struct { // The virtual server instance identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -38823,6 +39388,12 @@ func (_options *DeleteInstanceOptions) SetID(id string) *DeleteInstanceOptions { return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteInstanceOptions) SetIfMatch(ifMatch string) *DeleteInstanceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *DeleteInstanceOptions) SetHeaders(param map[string]string) *DeleteInstanceOptions { options.Headers = param @@ -39340,6 +39911,34 @@ func (options *DeletePublicGatewayOptions) SetHeaders(param map[string]string) * return options } +// DeleteReservationOptions : The DeleteReservation options. +type DeleteReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewDeleteReservationOptions : Instantiate DeleteReservationOptions +func (*VpcV1) NewDeleteReservationOptions(id string) *DeleteReservationOptions { + return &DeleteReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *DeleteReservationOptions) SetID(id string) *DeleteReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteReservationOptions) SetHeaders(param map[string]string) *DeleteReservationOptions { + options.Headers = param + return options +} + // DeleteSecurityGroupOptions : The DeleteSecurityGroup options. type DeleteSecurityGroupOptions struct { // The security group identifier. @@ -41489,16 +42088,16 @@ type FloatingIPTarget struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The name for this instance network interface. @@ -41587,16 +42186,16 @@ type FloatingIPTargetPatch struct { // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` // The CRN for this virtual network interface. @@ -41645,16 +42244,16 @@ type FloatingIPTargetPrototype struct { // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` // The CRN for this virtual network interface. @@ -41991,16 +42590,16 @@ type FlowLogCollectorTarget struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The name for this instance network interface. @@ -42092,16 +42691,16 @@ type FlowLogCollectorTargetPrototype struct { // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` // The CRN for this virtual server instance. @@ -44073,6 +44672,34 @@ func (options *GetRegionZoneOptions) SetHeaders(param map[string]string) *GetReg return options } +// GetReservationOptions : The GetReservation options. +type GetReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetReservationOptions : Instantiate GetReservationOptions +func (*VpcV1) NewGetReservationOptions(id string) *GetReservationOptions { + return &GetReservationOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *GetReservationOptions) SetID(id string) *GetReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetReservationOptions) SetHeaders(param map[string]string) *GetReservationOptions { + options.Headers = param + return options +} + // GetSecurityGroupOptions : The GetSecurityGroup options. type GetSecurityGroupOptions struct { // The security group identifier. @@ -47139,6 +47766,27 @@ type Instance struct { // The virtual server instance GPU configuration. Gpu *InstanceGpu `json:"gpu,omitempty"` + // The reasons for the current instance `health_state` (if any): + // - `reservation_capacity_unavailable`: The reservation affinity pool has no + // available capacity. + // - `reservation_deleted`: The reservation affinity pool has a deleted reservation. + // - `reservation_expired`: The reservation affinity pool has an expired reservation. + // - `reservation_failed`: The reservation affinity pool has a failed reservation. + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + HealthReasons []InstanceHealthReason `json:"health_reasons" validate:"required"` + + // The health of this resource. + // - `ok`: No abnormal behavior detected + // - `degraded`: Experiencing compromised performance, capacity, or connectivity + // - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated + // - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a + // lifecycle state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also + // have this state. + HealthState *string `json:"health_state" validate:"required"` + // The URL for this virtual server instance. Href *string `json:"href" validate:"required"` @@ -47173,8 +47821,8 @@ type Instance struct { // The network interfaces for this instance, including the primary network interface. // // If this instance has network attachments, each network interface is a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network attachment - // and its attached virtual network interface. + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding network + // attachment and its attached virtual network interface. NetworkInterfaces []NetworkInterfaceInstanceContextReference `json:"network_interfaces" validate:"required"` // The number of NUMA nodes this virtual server instance is provisioned on. @@ -47192,7 +47840,7 @@ type Instance struct { // // If this instance has network attachments, this primary network interface is a // [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) // of the primary network attachment and its attached virtual network interface. PrimaryNetworkInterface *NetworkInterfaceInstanceContextReference `json:"primary_network_interface" validate:"required"` @@ -47200,6 +47848,13 @@ type Instance struct { // server instance. Profile *InstanceProfileReference `json:"profile" validate:"required"` + // The reservation used by this virtual server instance. + // + // If absent, no reservation is in use. + Reservation *ReservationReference `json:"reservation,omitempty"` + + ReservationAffinity *InstanceReservationAffinity `json:"reservation_affinity" validate:"required"` + // The resource group for this instance. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -47245,6 +47900,21 @@ type Instance struct { Zone *ZoneReference `json:"zone" validate:"required"` } +// Constants associated with the Instance.HealthState property. +// The health of this resource. +// - `ok`: No abnormal behavior detected +// - `degraded`: Experiencing compromised performance, capacity, or connectivity +// - `faulted`: Completely unreachable, inoperative, or otherwise entirely incapacitated +// - `inapplicable`: The health state does not apply because of the current lifecycle state. A resource with a lifecycle +// state of `failed` or `deleting` will have a health state of `inapplicable`. A `pending` resource may also have this +// state. +const ( + InstanceHealthStateDegradedConst = "degraded" + InstanceHealthStateFaultedConst = "faulted" + InstanceHealthStateInapplicableConst = "inapplicable" + InstanceHealthStateOkConst = "ok" +) + // Constants associated with the Instance.LifecycleState property. // The lifecycle state of the virtual server instance. const ( @@ -47319,6 +47989,14 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } + err = core.UnmarshalModel(m, "health_reasons", &obj.HealthReasons, UnmarshalInstanceHealthReason) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "health_state", &obj.HealthState) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { return @@ -47379,6 +48057,14 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er if err != nil { return } + err = core.UnmarshalModel(m, "reservation", &obj.Reservation, UnmarshalReservationReference) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinity) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -50075,6 +50761,46 @@ func UnmarshalInstanceGroupReferenceDeleted(m map[string]json.RawMessage, result return } +// InstanceHealthReason : InstanceHealthReason struct +type InstanceHealthReason struct { + // A snake case string succinctly identifying the reason for this health state. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this health state. + Message *string `json:"message" validate:"required"` + + // Link to documentation about the reason for this health state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the InstanceHealthReason.Code property. +// A snake case string succinctly identifying the reason for this health state. +const ( + InstanceHealthReasonCodeReservationCapacityUnavailableConst = "reservation_capacity_unavailable" + InstanceHealthReasonCodeReservationDeletedConst = "reservation_deleted" + InstanceHealthReasonCodeReservationExpiredConst = "reservation_expired" + InstanceHealthReasonCodeReservationFailedConst = "reservation_failed" +) + +// UnmarshalInstanceHealthReason unmarshals an instance of InstanceHealthReason from the specified map of raw messages. +func UnmarshalInstanceHealthReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceHealthReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceInitialization : InstanceInitialization struct type InstanceInitialization struct { // The default trusted profile configuration specified at virtual server instance @@ -50764,6 +51490,8 @@ type InstancePatch struct { // The placement restrictions to use for the virtual server instance. For the placement // restrictions to be changed, the instance `status` must be `stopping` or `stopped`. + // + // If set, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPatchIntf `json:"placement_target,omitempty"` // The profile to use for this virtual server instance. For the profile to be changed, @@ -50780,6 +51508,8 @@ type InstancePatch struct { // currently has. Profile InstancePatchProfileIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` + // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in // this value will result in a corresponding decrease to // `total_network_bandwidth`. @@ -50809,6 +51539,10 @@ func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPatch) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) if err != nil { return @@ -51065,6 +51799,11 @@ type InstanceProfile struct { PortSpeed InstanceProfilePortSpeedIntf `json:"port_speed" validate:"required"` + ReservationTerms *InstanceProfileReservationTerms `json:"reservation_terms" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + // The status of the instance profile: // - `previous`: This instance profile is an older revision, but remains provisionable and // usable. @@ -51089,6 +51828,12 @@ type InstanceProfile struct { VcpuManufacturer *InstanceProfileVcpuManufacturer `json:"vcpu_manufacturer" validate:"required"` } +// Constants associated with the InstanceProfile.ResourceType property. +// The resource type. +const ( + InstanceProfileResourceTypeInstanceProfileConst = "instance_profile" +) + // Constants associated with the InstanceProfile.Status property. // The status of the instance profile: // - `previous`: This instance profile is an older revision, but remains provisionable and @@ -51171,6 +51916,14 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "reservation_terms", &obj.ReservationTerms, UnmarshalInstanceProfileReservationTerms) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { return @@ -52088,8 +52841,17 @@ type InstanceProfileReference struct { // The globally unique name for this virtual server instance profile. Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` } +// Constants associated with the InstanceProfileReference.ResourceType property. +// The resource type. +const ( + InstanceProfileReferenceResourceTypeInstanceProfileConst = "instance_profile" +) + // UnmarshalInstanceProfileReference unmarshals an instance of InstanceProfileReference from the specified map of raw messages. func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstanceProfileReference) @@ -52101,6 +52863,46 @@ func UnmarshalInstanceProfileReference(m map[string]json.RawMessage, result inte if err != nil { return } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileReservationTerms : InstanceProfileReservationTerms struct +type InstanceProfileReservationTerms struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The supported committed use terms for a reservation using this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileReservationTerms.Type property. +// The type for this profile field. +const ( + InstanceProfileReservationTermsTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileReservationTerms.Values property. +const ( + InstanceProfileReservationTermsValuesOneYearConst = "one_year" + InstanceProfileReservationTermsValuesThreeYearConst = "three_year" +) + +// UnmarshalInstanceProfileReservationTerms unmarshals an instance of InstanceProfileReservationTerms from the specified map of raw messages. +func UnmarshalInstanceProfileReservationTerms(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileReservationTerms) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -52378,6 +53180,8 @@ type InstancePrototype struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this @@ -52387,6 +53191,8 @@ type InstancePrototype struct { // in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -52415,12 +53221,6 @@ type InstancePrototype struct { // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image,omitempty"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone,omitempty"` @@ -52430,6 +53230,12 @@ type InstancePrototype struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering // or offering version to use when provisioning this virtual server instance. // @@ -52483,6 +53289,10 @@ func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{} if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -52511,23 +53321,23 @@ func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{} if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -52607,6 +53417,132 @@ func UnmarshalInstanceReferenceDeleted(m map[string]json.RawMessage, result inte return } +// InstanceReservationAffinity : InstanceReservationAffinity struct +type InstanceReservationAffinity struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` are available for use. + Policy *string `json:"policy" validate:"required"` + + // The pool of reservations available for use by this virtual server instance. + Pool []ReservationReference `json:"pool" validate:"required"` +} + +// Constants associated with the InstanceReservationAffinity.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` are available for use. +const ( + InstanceReservationAffinityPolicyDisabledConst = "disabled" + InstanceReservationAffinityPolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinity unmarshals an instance of InstanceReservationAffinity from the specified map of raw messages. +func UnmarshalInstanceReservationAffinity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinity) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinityPatch : InstanceReservationAffinityPatch struct +type InstanceReservationAffinityPatch struct { + // The reservation affinity policy for this virtual server instance. + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected property value was encountered. + Policy *string `json:"policy,omitempty"` + + // The pool of reservations available for use by this virtual server instance, replacing the existing pool of + // reservations. + // + // Specified reservations must have a `status` of `active`, and have the same `profile` and + // `zone` as this virtual server instance. + // + // If `policy` is `manual`, a pool must be specified with at least one reservation. If + // `policy` is `disabled` and a pool is specified, it must be empty. + Pool []ReservationIdentityIntf `json:"pool,omitempty"` +} + +// Constants associated with the InstanceReservationAffinityPatch.Policy property. +// The reservation affinity policy for this virtual server instance. +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the +// unexpected property value was encountered. +const ( + InstanceReservationAffinityPatchPolicyDisabledConst = "disabled" + InstanceReservationAffinityPatchPolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinityPatch unmarshals an instance of InstanceReservationAffinityPatch from the specified map of raw messages. +func UnmarshalInstanceReservationAffinityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinityPatch) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceReservationAffinityPrototype : InstanceReservationAffinityPrototype struct +type InstanceReservationAffinityPrototype struct { + // The reservation affinity policy to use for this virtual server instance: + // - `disabled`: Reservations will not be used + // - `manual`: Reservations in `pool` will be available for use + // + // The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. + Policy *string `json:"policy,omitempty"` + + // The pool of reservations available for use by this virtual server instance. + // + // Specified reservations must have a `status` of `active`, and have the same `profile` and + // `zone` as this virtual server instance. + // + // If `policy` is `manual`, a pool must be specified with at least one reservation. If + // `policy` is `disabled` and a pool is specified, it must be empty. + Pool []ReservationIdentityIntf `json:"pool,omitempty"` +} + +// Constants associated with the InstanceReservationAffinityPrototype.Policy property. +// The reservation affinity policy to use for this virtual server instance: +// - `disabled`: Reservations will not be used +// - `manual`: Reservations in `pool` will be available for use +// +// The policy will default to `manual` if `pool` is not empty, and `disabled` otherwise. +const ( + InstanceReservationAffinityPrototypePolicyDisabledConst = "disabled" + InstanceReservationAffinityPrototypePolicyManualConst = "manual" +) + +// UnmarshalInstanceReservationAffinityPrototype unmarshals an instance of InstanceReservationAffinityPrototype from the specified map of raw messages. +func UnmarshalInstanceReservationAffinityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceReservationAffinityPrototype) + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "pool", &obj.Pool, UnmarshalReservationIdentity) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceStatusReason : InstanceStatusReason struct type InstanceStatusReason struct { // A snake case string succinctly identifying the status reason. @@ -52622,16 +53558,18 @@ type InstanceStatusReason struct { // Constants associated with the InstanceStatusReason.Code property. // A snake case string succinctly identifying the status reason. const ( - InstanceStatusReasonCodeCannotStartConst = "cannot_start" - InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" - InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" - InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" - InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" - InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" - InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" - InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" - InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" - InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" + InstanceStatusReasonCodeCannotStartConst = "cannot_start" + InstanceStatusReasonCodeCannotStartCapacityConst = "cannot_start_capacity" + InstanceStatusReasonCodeCannotStartComputeConst = "cannot_start_compute" + InstanceStatusReasonCodeCannotStartIPAddressConst = "cannot_start_ip_address" + InstanceStatusReasonCodeCannotStartNetworkConst = "cannot_start_network" + InstanceStatusReasonCodeCannotStartPlacementGroupConst = "cannot_start_placement_group" + InstanceStatusReasonCodeCannotStartReservationCapacityConst = "cannot_start_reservation_capacity" + InstanceStatusReasonCodeCannotStartReservationExpiredConst = "cannot_start_reservation_expired" + InstanceStatusReasonCodeCannotStartStorageConst = "cannot_start_storage" + InstanceStatusReasonCodeEncryptionKeyDeletedConst = "encryption_key_deleted" + InstanceStatusReasonCodeStoppedByHostFailureConst = "stopped_by_host_failure" + InstanceStatusReasonCodeStoppedForImageCreationConst = "stopped_for_image_creation" ) // UnmarshalInstanceStatusReason unmarshals an instance of InstanceStatusReason from the specified map of raw messages. @@ -52703,6 +53641,8 @@ type InstanceTemplate struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this @@ -52712,6 +53652,8 @@ type InstanceTemplate struct { // in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -52739,12 +53681,6 @@ type InstanceTemplate struct { // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image,omitempty"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone,omitempty"` @@ -52754,6 +53690,12 @@ type InstanceTemplate struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering // or offering version to use when provisioning this virtual server instance. // @@ -52820,6 +53762,10 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -52848,23 +53794,23 @@ func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -53066,6 +54012,8 @@ type InstanceTemplatePrototype struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this @@ -53075,6 +54023,8 @@ type InstanceTemplatePrototype struct { // in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group to use. If unspecified, the account's [default resource // group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` @@ -53103,12 +54053,6 @@ type InstanceTemplatePrototype struct { // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image,omitempty"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone,omitempty"` @@ -53118,6 +54062,12 @@ type InstanceTemplatePrototype struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` + // The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) // offering version to use when provisioning this virtual server instance. // If an offering is specified, the latest version of that offering will be used. @@ -53172,6 +54122,10 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -53200,23 +54154,23 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -55500,6 +56454,15 @@ type ListInstancesOptions struct { // group name. PlacementGroupName *string `json:"placement_group.name,omitempty"` + // Filters the collection to instances with a `reservation.id` property matching the specified identifier. + ReservationID *string `json:"reservation.id,omitempty"` + + // Filters the collection to instances with a `reservation.crn` property matching the specified CRN. + ReservationCRN *string `json:"reservation.crn,omitempty"` + + // Filters the collection to resources with a `reservation.name` property matching the exact specified name. + ReservationName *string `json:"reservation.name,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -55587,6 +56550,24 @@ func (_options *ListInstancesOptions) SetPlacementGroupName(placementGroupName s return _options } +// SetReservationID : Allow user to set ReservationID +func (_options *ListInstancesOptions) SetReservationID(reservationID string) *ListInstancesOptions { + _options.ReservationID = core.StringPtr(reservationID) + return _options +} + +// SetReservationCRN : Allow user to set ReservationCRN +func (_options *ListInstancesOptions) SetReservationCRN(reservationCRN string) *ListInstancesOptions { + _options.ReservationCRN = core.StringPtr(reservationCRN) + return _options +} + +// SetReservationName : Allow user to set ReservationName +func (_options *ListInstancesOptions) SetReservationName(reservationName string) *ListInstancesOptions { + _options.ReservationName = core.StringPtr(reservationName) + return _options +} + // SetHeaders : Allow user to set Headers func (options *ListInstancesOptions) SetHeaders(param map[string]string) *ListInstancesOptions { options.Headers = param @@ -56275,6 +57256,68 @@ func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegi return options } +// ListReservationsOptions : The ListReservations options. +type ListReservationsOptions struct { + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Filters the collection to resources with a `name` property matching the exact specified name. + Name *string `json:"name,omitempty"` + + // Filters the collection to resources with a `resource_group.id` property matching the specified identifier. + ResourceGroupID *string `json:"resource_group.id,omitempty"` + + // Filters the collection to resources with a `zone.name` property matching the exact specified name. + ZoneName *string `json:"zone.name,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListReservationsOptions : Instantiate ListReservationsOptions +func (*VpcV1) NewListReservationsOptions() *ListReservationsOptions { + return &ListReservationsOptions{} +} + +// SetStart : Allow user to set Start +func (_options *ListReservationsOptions) SetStart(start string) *ListReservationsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListReservationsOptions) SetLimit(limit int64) *ListReservationsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListReservationsOptions) SetName(name string) *ListReservationsOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListReservationsOptions) SetResourceGroupID(resourceGroupID string) *ListReservationsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + +// SetZoneName : Allow user to set ZoneName +func (_options *ListReservationsOptions) SetZoneName(zoneName string) *ListReservationsOptions { + _options.ZoneName = core.StringPtr(zoneName) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListReservationsOptions) SetHeaders(param map[string]string) *ListReservationsOptions { + options.Headers = param + return options +} + // ListSecurityGroupRulesOptions : The ListSecurityGroupRules options. type ListSecurityGroupRulesOptions struct { // The security group identifier. @@ -63389,54 +64432,55 @@ type NetworkInterface struct { // Indicates whether source IP spoofing is allowed on this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` // The date and time that the instance network interface was created. // // If this instance has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) when its corresponding network attachment - // was created. + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // The floating IPs associated with this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the floating IPs are associated with the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the name matches its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` // The instance network interface port speed in Mbps. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the port speed is that of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. PortSpeed *int64 `json:"port_speed" validate:"required"` PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` @@ -63447,16 +64491,16 @@ type NetworkInterface struct { // The security groups targeting this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the security groups are associated with the attached - // virtual network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` // The status of the instance network interface. // // If this instance has network attachments, this network interface is a read-only representation of its corresponding // network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). Status *string `json:"status" validate:"required"` // The associated subnet. @@ -63465,8 +64509,9 @@ type NetworkInterface struct { // The instance network interface type. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. Type *string `json:"type" validate:"required"` } @@ -63481,7 +64526,7 @@ const ( // // If this instance has network attachments, this network interface is a read-only representation of its corresponding // network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( NetworkInterfaceStatusAvailableConst = "available" NetworkInterfaceStatusDeletingConst = "deleting" @@ -63493,8 +64538,9 @@ const ( // The instance network interface type. // // If this instance has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( NetworkInterfaceTypePrimaryConst = "primary" NetworkInterfaceTypeSecondaryConst = "secondary" @@ -63568,16 +64614,16 @@ type NetworkInterfaceBareMetalServerContextReference struct { // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this bare metal server network interface. @@ -63721,16 +64767,16 @@ type NetworkInterfaceInstanceContextReference struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this instance network interface. @@ -63809,9 +64855,9 @@ type NetworkInterfacePatch struct { // Indicates whether source IP spoofing is allowed on this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The name for the instance network interface. The name must not be used by another network interface on the virtual @@ -63849,9 +64895,9 @@ type NetworkInterfacePrototype struct { // Indicates whether source IP spoofing is allowed on this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // The name for the instance network interface. The name must not be used by another network interface on the virtual @@ -65461,6 +66507,882 @@ func (options *ReplaceSubnetRoutingTableOptions) SetHeaders(param map[string]str return options } +// Reservation : Reservation struct +type Reservation struct { + // The affinity policy to use for this reservation: + // - `restricted`: The reservation must be manually requested + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + AffinityPolicy *string `json:"affinity_policy" validate:"required"` + + // The capacity configuration for this reservation + // + // If absent, this reservation has no assigned capacity. + Capacity *ReservationCapacity `json:"capacity,omitempty"` + + // The committed use configuration for this reservation. + // + // If absent, this reservation has no commitment for use. + CommittedUse *ReservationCommittedUse `json:"committed_use,omitempty"` + + // The date and time that the reservation was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` + + // The URL for this reservation. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of this reservation. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this reservation. The name is unique across all reservations in the region. + Name *string `json:"name" validate:"required"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. + Profile *ReservationProfile `json:"profile" validate:"required"` + + // The resource group for this reservation. + ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of the reservation. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + // + // The enumerated reason code values for this property will expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the + // unexpected reason code was encountered. + StatusReasons []ReservationStatusReason `json:"status_reasons" validate:"required"` + + // The zone for this reservation. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the Reservation.AffinityPolicy property. +// The affinity policy to use for this reservation: +// - `restricted`: The reservation must be manually requested +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationAffinityPolicyRestrictedConst = "restricted" +) + +// Constants associated with the Reservation.LifecycleState property. +// The lifecycle state of this reservation. +const ( + ReservationLifecycleStateDeletingConst = "deleting" + ReservationLifecycleStateFailedConst = "failed" + ReservationLifecycleStatePendingConst = "pending" + ReservationLifecycleStateStableConst = "stable" + ReservationLifecycleStateSuspendedConst = "suspended" + ReservationLifecycleStateUpdatingConst = "updating" + ReservationLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Reservation.ResourceType property. +// The resource type. +const ( + ReservationResourceTypeReservationConst = "reservation" +) + +// Constants associated with the Reservation.Status property. +// The status of the reservation. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationStatusActivatingConst = "activating" + ReservationStatusActiveConst = "active" + ReservationStatusDeactivatingConst = "deactivating" + ReservationStatusExpiredConst = "expired" + ReservationStatusFailedConst = "failed" + ReservationStatusInactiveConst = "inactive" +) + +// UnmarshalReservation unmarshals an instance of Reservation from the specified map of raw messages. +func UnmarshalReservation(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Reservation) + err = core.UnmarshalPrimitive(m, "affinity_policy", &obj.AffinityPolicy) + if err != nil { + return + } + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacity) + if err != nil { + return + } + err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUse) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfile) + if err != nil { + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalReservationStatusReason) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCapacity : The capacity configuration for this reservation +// +// If absent, this reservation has no assigned capacity. +type ReservationCapacity struct { + // The amount allocated to this capacity reservation. + Allocated *int64 `json:"allocated" validate:"required"` + + // The amount of this capacity reservation available for new attachments. + Available *int64 `json:"available" validate:"required"` + + // The status of the capacity reservation: + // - `allocating`: The capacity reservation is being allocated for use + // - `allocated`: The total capacity of the reservation has been allocated for use + // - `degraded`: The capacity reservation has been allocated for use, but some of the + // capacity is not available. + // See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more information. + // - `unallocated`: The capacity reservation is not allocated for use + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Status *string `json:"status" validate:"required"` + + // The total amount of this capacity reservation. + Total *int64 `json:"total" validate:"required"` + + // The amount of this capacity reservation used by existing attachments. + Used *int64 `json:"used" validate:"required"` +} + +// Constants associated with the ReservationCapacity.Status property. +// The status of the capacity reservation: +// - `allocating`: The capacity reservation is being allocated for use +// - `allocated`: The total capacity of the reservation has been allocated for use +// - `degraded`: The capacity reservation has been allocated for use, but some of the +// capacity is not available. +// See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more information. +// - `unallocated`: The capacity reservation is not allocated for use +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCapacityStatusAllocatedConst = "allocated" + ReservationCapacityStatusAllocatingConst = "allocating" + ReservationCapacityStatusDegradedConst = "degraded" + ReservationCapacityStatusUnallocatedConst = "unallocated" +) + +// UnmarshalReservationCapacity unmarshals an instance of ReservationCapacity from the specified map of raw messages. +func UnmarshalReservationCapacity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacity) + err = core.UnmarshalPrimitive(m, "allocated", &obj.Allocated) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "available", &obj.Available) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "used", &obj.Used) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCapacityPatch : The capacity reservation configuration to use. +// +// The configuration can only be changed for reservations with a `status` of `inactive`. +type ReservationCapacityPatch struct { + // The total amount to use for this capacity reservation. + Total *int64 `json:"total,omitempty"` +} + +// UnmarshalReservationCapacityPatch unmarshals an instance of ReservationCapacityPatch from the specified map of raw messages. +func UnmarshalReservationCapacityPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacityPatch) + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCapacityPrototype : The capacity reservation configuration to use. +type ReservationCapacityPrototype struct { + // The total amount to use for this capacity reservation. + Total *int64 `json:"total" validate:"required"` +} + +// NewReservationCapacityPrototype : Instantiate ReservationCapacityPrototype (Generic Model Constructor) +func (*VpcV1) NewReservationCapacityPrototype(total int64) (_model *ReservationCapacityPrototype, err error) { + _model = &ReservationCapacityPrototype{ + Total: core.Int64Ptr(total), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalReservationCapacityPrototype unmarshals an instance of ReservationCapacityPrototype from the specified map of raw messages. +func UnmarshalReservationCapacityPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCapacityPrototype) + err = core.UnmarshalPrimitive(m, "total", &obj.Total) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCollection : ReservationCollection struct +type ReservationCollection struct { + // A link to the first page of resources. + First *ReservationCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *ReservationCollectionNext `json:"next,omitempty"` + + // Collection of reservations. + Reservations []Reservation `json:"reservations" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalReservationCollection unmarshals an instance of ReservationCollection from the specified map of raw messages. +func UnmarshalReservationCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalReservationCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalReservationCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "reservations", &obj.Reservations, UnmarshalReservation) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ReservationCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// ReservationCollectionFirst : A link to the first page of resources. +type ReservationCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservationCollectionFirst unmarshals an instance of ReservationCollectionFirst from the specified map of raw messages. +func UnmarshalReservationCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type ReservationCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalReservationCollectionNext unmarshals an instance of ReservationCollectionNext from the specified map of raw messages. +func UnmarshalReservationCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCommittedUse : The committed use reservation configuration. +type ReservationCommittedUse struct { + // The expiration date and time for this committed use reservation. + ExpirationAt *strfmt.DateTime `json:"expiration_at" validate:"required"` + + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy" validate:"required"` + + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + Term *string `json:"term" validate:"required"` +} + +// Constants associated with the ReservationCommittedUse.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUseExpirationPolicyReleaseConst = "release" + ReservationCommittedUseExpirationPolicyRenewConst = "renew" +) + +// UnmarshalReservationCommittedUse unmarshals an instance of ReservationCommittedUse from the specified map of raw messages. +func UnmarshalReservationCommittedUse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUse) + err = core.UnmarshalPrimitive(m, "expiration_at", &obj.ExpirationAt) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCommittedUsePatch : ReservationCommittedUsePatch struct +type ReservationCommittedUsePatch struct { + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy,omitempty"` + + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The specified value must be listed in the `reservation_terms` in the profile for this reservation. The term can only + // be changed for a reservation with a `status` of + // `inactive`. + Term *string `json:"term,omitempty"` +} + +// Constants associated with the ReservationCommittedUsePatch.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUsePatchExpirationPolicyReleaseConst = "release" + ReservationCommittedUsePatchExpirationPolicyRenewConst = "renew" +) + +// UnmarshalReservationCommittedUsePatch unmarshals an instance of ReservationCommittedUsePatch from the specified map of raw messages. +func UnmarshalReservationCommittedUsePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUsePatch) + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationCommittedUsePrototype : ReservationCommittedUsePrototype struct +type ReservationCommittedUsePrototype struct { + // The policy to apply when the committed use term expires: + // - `release`: Release any available capacity and let the reservation expire. + // - `renew`: Renew for another term, provided the term remains listed in the + // `reservation_terms` for the profile. Otherwise, let the reservation expire. + // + // The enumerated values for this property may expand in the future. When processing this property, check for and log + // unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected + // property value was encountered. + ExpirationPolicy *string `json:"expiration_policy,omitempty"` + + // The term for this committed use reservation: + // - `one_year`: 1 year + // - `three_year`: 3 years + // + // The specified value must be listed in the `reservation_terms` in the profile for this reservation. + Term *string `json:"term" validate:"required"` +} + +// Constants associated with the ReservationCommittedUsePrototype.ExpirationPolicy property. +// The policy to apply when the committed use term expires: +// - `release`: Release any available capacity and let the reservation expire. +// - `renew`: Renew for another term, provided the term remains listed in the +// `reservation_terms` for the profile. Otherwise, let the reservation expire. +// +// The enumerated values for this property may expand in the future. When processing this property, check for and log +// unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected +// property value was encountered. +const ( + ReservationCommittedUsePrototypeExpirationPolicyReleaseConst = "release" + ReservationCommittedUsePrototypeExpirationPolicyRenewConst = "renew" +) + +// NewReservationCommittedUsePrototype : Instantiate ReservationCommittedUsePrototype (Generic Model Constructor) +func (*VpcV1) NewReservationCommittedUsePrototype(term string) (_model *ReservationCommittedUsePrototype, err error) { + _model = &ReservationCommittedUsePrototype{ + Term: core.StringPtr(term), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalReservationCommittedUsePrototype unmarshals an instance of ReservationCommittedUsePrototype from the specified map of raw messages. +func UnmarshalReservationCommittedUsePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationCommittedUsePrototype) + err = core.UnmarshalPrimitive(m, "expiration_policy", &obj.ExpirationPolicy) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "term", &obj.Term) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationIdentity : Identifies a reservation by a unique property. +// Models which "extend" this model: +// - ReservationIdentityByID +// - ReservationIdentityByCRN +// - ReservationIdentityByHref +type ReservationIdentity struct { + // The unique identifier for this reservation. + ID *string `json:"id,omitempty"` + + // The CRN for this reservation. + CRN *string `json:"crn,omitempty"` + + // The URL for this reservation. + Href *string `json:"href,omitempty"` +} + +func (*ReservationIdentity) isaReservationIdentity() bool { + return true +} + +type ReservationIdentityIntf interface { + isaReservationIdentity() bool +} + +// UnmarshalReservationIdentity unmarshals an instance of ReservationIdentity from the specified map of raw messages. +func UnmarshalReservationIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationPatch : ReservationPatch struct +type ReservationPatch struct { + // The capacity reservation configuration to use. + // + // The configuration can only be changed for reservations with a `status` of `inactive`. + Capacity *ReservationCapacityPatch `json:"capacity,omitempty"` + + // The committed use configuration to use for this reservation. + CommittedUse *ReservationCommittedUsePatch `json:"committed_use,omitempty"` + + // The name for this reservation. The name must not be used by another reservation in the region. + Name *string `json:"name,omitempty"` + + // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + // reservation. + // + // The profile can only be changed for a reservation with a `status` of `inactive`. + Profile *ReservationProfilePatch `json:"profile,omitempty"` +} + +// UnmarshalReservationPatch unmarshals an instance of ReservationPatch from the specified map of raw messages. +func UnmarshalReservationPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationPatch) + err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalReservationCapacityPatch) + if err != nil { + return + } + err = core.UnmarshalModel(m, "committed_use", &obj.CommittedUse, UnmarshalReservationCommittedUsePatch) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalReservationProfilePatch) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the ReservationPatch +func (reservationPatch *ReservationPatch) AsPatch() (_patch map[string]interface{}, err error) { + var jsonData []byte + jsonData, err = json.Marshal(reservationPatch) + if err == nil { + err = json.Unmarshal(jsonData, &_patch) + } + return +} + +// ReservationProfile : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation. +type ReservationProfile struct { + // The URL for this virtual server instance profile. + Href *string `json:"href" validate:"required"` + + // The globally unique name for this virtual server instance profile. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservationProfile.ResourceType property. +// The resource type. +const ( + ReservationProfileResourceTypeInstanceProfileConst = "instance_profile" +) + +// UnmarshalReservationProfile unmarshals an instance of ReservationProfile from the specified map of raw messages. +func UnmarshalReservationProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfile) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationProfilePatch : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. +// +// The profile can only be changed for a reservation with a `status` of `inactive`. +type ReservationProfilePatch struct { + // The globally unique name of the profile. + Name *string `json:"name,omitempty"` + + // The resource type of the profile. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the ReservationProfilePatch.ResourceType property. +// The resource type of the profile. +const ( + ReservationProfilePatchResourceTypeInstanceProfileConst = "instance_profile" +) + +// UnmarshalReservationProfilePatch unmarshals an instance of ReservationProfilePatch from the specified map of raw messages. +func UnmarshalReservationProfilePatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfilePatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationProfilePrototype : The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this reservation. +type ReservationProfilePrototype struct { + // The globally unique name of the profile. + Name *string `json:"name" validate:"required"` + + // The resource type of the profile. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservationProfilePrototype.ResourceType property. +// The resource type of the profile. +const ( + ReservationProfilePrototypeResourceTypeInstanceProfileConst = "instance_profile" +) + +// NewReservationProfilePrototype : Instantiate ReservationProfilePrototype (Generic Model Constructor) +func (*VpcV1) NewReservationProfilePrototype(name string, resourceType string) (_model *ReservationProfilePrototype, err error) { + _model = &ReservationProfilePrototype{ + Name: core.StringPtr(name), + ResourceType: core.StringPtr(resourceType), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalReservationProfilePrototype unmarshals an instance of ReservationProfilePrototype from the specified map of raw messages. +func UnmarshalReservationProfilePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationProfilePrototype) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationReference : ReservationReference struct +type ReservationReference struct { + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *ReservationReferenceDeleted `json:"deleted,omitempty"` + + // The URL for this reservation. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` + + // The name for this reservation. The name is unique across all reservations in the region. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the ReservationReference.ResourceType property. +// The resource type. +const ( + ReservationReferenceResourceTypeReservationConst = "reservation" +) + +// UnmarshalReservationReference unmarshals an instance of ReservationReference from the specified map of raw messages. +func UnmarshalReservationReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalReservationReferenceDeleted) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationReferenceDeleted : If present, this property indicates the referenced resource has been deleted, and provides some supplementary +// information. +type ReservationReferenceDeleted struct { + // Link to documentation about deleted resources. + MoreInfo *string `json:"more_info" validate:"required"` +} + +// UnmarshalReservationReferenceDeleted unmarshals an instance of ReservationReferenceDeleted from the specified map of raw messages. +func UnmarshalReservationReferenceDeleted(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationReferenceDeleted) + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationStatusReason : ReservationStatusReason struct +type ReservationStatusReason struct { + // A snake case string succinctly identifying the status reason. + Code *string `json:"code" validate:"required"` + + // An explanation of the status reason. + Message *string `json:"message" validate:"required"` + + // Link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the ReservationStatusReason.Code property. +// A snake case string succinctly identifying the status reason. +const ( + ReservationStatusReasonCodeCannotActivateNoCapacityAvailableConst = "cannot_activate_no_capacity_available" + ReservationStatusReasonCodeCannotRenewUnsupportedProfileTermConst = "cannot_renew_unsupported_profile_term" +) + +// UnmarshalReservationStatusReason unmarshals an instance of ReservationStatusReason from the specified map of raw messages. +func UnmarshalReservationStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ReservedIP : ReservedIP struct type ReservedIP struct { // The IP address. @@ -66428,350 +68350,360 @@ type Route struct { // distributed between them. Priority *int64 `json:"priority" validate:"required"` - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). - Zone *ZoneReference `json:"zone" validate:"required"` -} - -// Constants associated with the Route.Action property. -// The action to perform with a packet matching the route: -// - `delegate`: delegate to system-provided routes -// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes -// - `deliver`: deliver the packet to the specified `next_hop` -// - `drop`: drop the packet. -const ( - RouteActionDelegateConst = "delegate" - RouteActionDelegateVPCConst = "delegate_vpc" - RouteActionDeliverConst = "deliver" - RouteActionDropConst = "drop" -) - -// Constants associated with the Route.LifecycleState property. -// The lifecycle state of the route. -const ( - RouteLifecycleStateDeletingConst = "deleting" - RouteLifecycleStateFailedConst = "failed" - RouteLifecycleStatePendingConst = "pending" - RouteLifecycleStateStableConst = "stable" - RouteLifecycleStateSuspendedConst = "suspended" - RouteLifecycleStateUpdatingConst = "updating" - RouteLifecycleStateWaitingConst = "waiting" -) - -// Constants associated with the Route.Origin property. -// The origin of this route: -// - `service`: route was directly created by a service -// - `user`: route was directly created by a user -// -// The enumerated values for this property are expected to expand in the future. When processing this property, check -// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the -// unexpected property value was encountered. -const ( - RouteOriginServiceConst = "service" - RouteOriginUserConst = "user" -) - -// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. -func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Route) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - return - } - err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) - if err != nil { - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollection : RouteCollection struct -type RouteCollection struct { - // A link to the first page of resources. - First *RouteCollectionFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RouteCollectionNext `json:"next,omitempty"` - - // Collection of routes. - Routes []Route `json:"routes" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. -func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollection) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// RouteCollectionFirst : A link to the first page of resources. -type RouteCollectionFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. -func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. -func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionVPCContext : RouteCollectionVPCContext struct -type RouteCollectionVPCContext struct { - // A link to the first page of resources. - First *RouteCollectionVPCContextFirst `json:"first" validate:"required"` - - // The maximum number of resources that can be returned by the request. - Limit *int64 `json:"limit" validate:"required"` - - // A link to the next page of resources. This property is present for all pages - // except the last page. - Next *RouteCollectionVPCContextNext `json:"next,omitempty"` - - // Collection of routes. - Routes []RouteCollectionVPCContextRoutesItem `json:"routes" validate:"required"` - - // The total number of resources across all pages. - TotalCount *int64 `json:"total_count" validate:"required"` -} - -// UnmarshalRouteCollectionVPCContext unmarshals an instance of RouteCollectionVPCContext from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContext) - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionVPCContextFirst) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionVPCContextNext) - if err != nil { - return - } - err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteCollectionVPCContextRoutesItem) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *RouteCollectionVPCContext) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - start, err := core.GetQueryParam(resp.Next.Href, "start") - if err != nil || start == nil { - return nil, err - } - return start, nil -} - -// RouteCollectionVPCContextFirst : A link to the first page of resources. -type RouteCollectionVPCContextFirst struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionVPCContextFirst unmarshals an instance of RouteCollectionVPCContextFirst from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextFirst) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionVPCContextNext : A link to the next page of resources. This property is present for all pages except the last page. -type RouteCollectionVPCContextNext struct { - // The URL for a page of resources. - Href *string `json:"href" validate:"required"` -} - -// UnmarshalRouteCollectionVPCContextNext unmarshals an instance of RouteCollectionVPCContextNext from the specified map of raw messages. -func UnmarshalRouteCollectionVPCContextNext(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RouteCollectionVPCContextNext) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// RouteCollectionVPCContextRoutesItem : RouteCollectionVPCContextRoutesItem struct -type RouteCollectionVPCContextRoutesItem struct { - // The action to perform with a packet matching the route: - // - `delegate`: delegate to system-provided routes - // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes - // - `deliver`: deliver the packet to the specified `next_hop` - // - `drop`: drop the packet. - Action *string `json:"action" validate:"required"` - - // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` - // routing table property. - Advertise *bool `json:"advertise" validate:"required"` - - // The date and time that the route was created. - CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` - - // If present, the resource that created the route. Routes with this property present cannot - // be directly deleted. All routes with an `origin` of `service` will have this property set, - // and future `origin` values may also have this property set. - Creator RouteCreatorIntf `json:"creator,omitempty"` - - // The destination CIDR of the route. - Destination *string `json:"destination" validate:"required"` - - // The URL for this route. - Href *string `json:"href" validate:"required"` - - // The unique identifier for this route. - ID *string `json:"id" validate:"required"` - - // The lifecycle state of the route. - LifecycleState *string `json:"lifecycle_state" validate:"required"` - - // The name for this route. The name is unique across all routes in the routing table. - Name *string `json:"name" validate:"required"` - - // If `action` is `deliver`, the next hop that packets will be delivered to. For - // other `action` values, its `address` will be `0.0.0.0`. - NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` - - // The origin of this route: - // - `service`: route was directly created by a service - // - `user`: route was directly created by a user + // The zone the route applies to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. + Zone *ZoneReference `json:"zone" validate:"required"` +} + +// Constants associated with the Route.Action property. +// The action to perform with a packet matching the route: +// - `delegate`: delegate to system-provided routes +// - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes +// - `deliver`: deliver the packet to the specified `next_hop` +// - `drop`: drop the packet. +const ( + RouteActionDelegateConst = "delegate" + RouteActionDelegateVPCConst = "delegate_vpc" + RouteActionDeliverConst = "deliver" + RouteActionDropConst = "drop" +) + +// Constants associated with the Route.LifecycleState property. +// The lifecycle state of the route. +const ( + RouteLifecycleStateDeletingConst = "deleting" + RouteLifecycleStateFailedConst = "failed" + RouteLifecycleStatePendingConst = "pending" + RouteLifecycleStateStableConst = "stable" + RouteLifecycleStateSuspendedConst = "suspended" + RouteLifecycleStateUpdatingConst = "updating" + RouteLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the Route.Origin property. +// The origin of this route: +// - `service`: route was directly created by a service +// - `user`: route was directly created by a user +// +// The enumerated values for this property are expected to expand in the future. When processing this property, check +// for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the +// unexpected property value was encountered. +const ( + RouteOriginServiceConst = "service" + RouteOriginUserConst = "user" +) + +// UnmarshalRoute unmarshals an instance of Route from the specified map of raw messages. +func UnmarshalRoute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Route) + err = core.UnmarshalPrimitive(m, "action", &obj.Action) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "advertise", &obj.Advertise) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalRouteCreator) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "destination", &obj.Destination) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next_hop", &obj.NextHop, UnmarshalRouteNextHop) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "origin", &obj.Origin) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "priority", &obj.Priority) + if err != nil { + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteCollection : RouteCollection struct +type RouteCollection struct { + // A link to the first page of resources. + First *RouteCollectionFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *RouteCollectionNext `json:"next,omitempty"` + + // Collection of routes. + Routes []Route `json:"routes" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalRouteCollection unmarshals an instance of RouteCollection from the specified map of raw messages. +func UnmarshalRouteCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRoute) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RouteCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// RouteCollectionFirst : A link to the first page of resources. +type RouteCollectionFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalRouteCollectionFirst unmarshals an instance of RouteCollectionFirst from the specified map of raw messages. +func UnmarshalRouteCollectionFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteCollectionNext : A link to the next page of resources. This property is present for all pages except the last page. +type RouteCollectionNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalRouteCollectionNext unmarshals an instance of RouteCollectionNext from the specified map of raw messages. +func UnmarshalRouteCollectionNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteCollectionVPCContext : RouteCollectionVPCContext struct +type RouteCollectionVPCContext struct { + // A link to the first page of resources. + First *RouteCollectionVPCContextFirst `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *RouteCollectionVPCContextNext `json:"next,omitempty"` + + // Collection of routes. + Routes []RouteCollectionVPCContextRoutesItem `json:"routes" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalRouteCollectionVPCContext unmarshals an instance of RouteCollectionVPCContext from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContext) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalRouteCollectionVPCContextFirst) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalRouteCollectionVPCContextNext) + if err != nil { + return + } + err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteCollectionVPCContextRoutesItem) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RouteCollectionVPCContext) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil || start == nil { + return nil, err + } + return start, nil +} + +// RouteCollectionVPCContextFirst : A link to the first page of resources. +type RouteCollectionVPCContextFirst struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalRouteCollectionVPCContextFirst unmarshals an instance of RouteCollectionVPCContextFirst from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContextFirst(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContextFirst) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteCollectionVPCContextNext : A link to the next page of resources. This property is present for all pages except the last page. +type RouteCollectionVPCContextNext struct { + // The URL for a page of resources. + Href *string `json:"href" validate:"required"` +} + +// UnmarshalRouteCollectionVPCContextNext unmarshals an instance of RouteCollectionVPCContextNext from the specified map of raw messages. +func UnmarshalRouteCollectionVPCContextNext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RouteCollectionVPCContextNext) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RouteCollectionVPCContextRoutesItem : RouteCollectionVPCContextRoutesItem struct +type RouteCollectionVPCContextRoutesItem struct { + // The action to perform with a packet matching the route: + // - `delegate`: delegate to system-provided routes + // - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + // - `deliver`: deliver the packet to the specified `next_hop` + // - `drop`: drop the packet. + Action *string `json:"action" validate:"required"` + + // Indicates whether this route will be advertised to the ingress sources specified by the `advertise_routes_to` + // routing table property. + Advertise *bool `json:"advertise" validate:"required"` + + // The date and time that the route was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // If present, the resource that created the route. Routes with this property present cannot + // be directly deleted. All routes with an `origin` of `service` will have this property set, + // and future `origin` values may also have this property set. + Creator RouteCreatorIntf `json:"creator,omitempty"` + + // The destination CIDR of the route. + Destination *string `json:"destination" validate:"required"` + + // The URL for this route. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this route. + ID *string `json:"id" validate:"required"` + + // The lifecycle state of the route. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this route. The name is unique across all routes in the routing table. + Name *string `json:"name" validate:"required"` + + // If `action` is `deliver`, the next hop that packets will be delivered to. For + // other `action` values, its `address` will be `0.0.0.0`. + NextHop RouteNextHopIntf `json:"next_hop" validate:"required"` + + // The origin of this route: + // - `service`: route was directly created by a service + // - `user`: route was directly created by a user + // + // The enumerated values for this property are expected to expand in the future. When processing this property, check + // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + // unexpected property value was encountered. + Origin *string `json:"origin,omitempty"` + + // The priority of this route. Smaller values have higher priority. + // + // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + // distributed between them. + Priority *int64 `json:"priority" validate:"required"` + + // The zone the route applies to. // - // The enumerated values for this property are expected to expand in the future. When processing this property, check - // for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the - // unexpected property value was encountered. - Origin *string `json:"origin,omitempty"` - - // The priority of this route. Smaller values have higher priority. - // - // If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest - // priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is - // distributed between them. - Priority *int64 `json:"priority" validate:"required"` - - // The zone the route applies to. (Traffic from subnets in this zone will be - // subject to this route.). + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. Zone *ZoneReference `json:"zone" validate:"required"` } @@ -67172,8 +69104,13 @@ type RoutePrototype struct { // distributed between them. Priority *int64 `json:"priority,omitempty"` - // The zone to apply the route to. (Traffic from subnets in this zone will be - // subject to this route.). + // The zone to apply the route to. + // + // If subnets are attached to the route's routing table, egress traffic from those + // subnets in this zone will be subject to this route. If this route's routing table + // has any of `route_direct_link_ingress`, `route_internet_ingress`, + // `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`, traffic + // from those ingress sources arriving in this zone will be subject to this route. Zone ZoneIdentityIntf `json:"zone" validate:"required"` } @@ -68938,16 +70875,16 @@ type SecurityGroupTargetReference struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The name for this instance network interface. @@ -74233,6 +76170,10 @@ type UpdateInstanceOptions struct { // The instance patch. InstancePatch map[string]interface{} `json:"Instance_patch" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -74257,6 +76198,12 @@ func (_options *UpdateInstanceOptions) SetInstancePatch(instancePatch map[string return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateInstanceOptions) SetIfMatch(ifMatch string) *UpdateInstanceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateInstanceOptions) SetHeaders(param map[string]string) *UpdateInstanceOptions { options.Headers = param @@ -74915,6 +76862,44 @@ func (options *UpdatePublicGatewayOptions) SetHeaders(param map[string]string) * return options } +// UpdateReservationOptions : The UpdateReservation options. +type UpdateReservationOptions struct { + // The reservation identifier. + ID *string `json:"id" validate:"required,ne="` + + // The reservation patch. + ReservationPatch map[string]interface{} `json:"Reservation_patch" validate:"required"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateReservationOptions : Instantiate UpdateReservationOptions +func (*VpcV1) NewUpdateReservationOptions(id string, reservationPatch map[string]interface{}) *UpdateReservationOptions { + return &UpdateReservationOptions{ + ID: core.StringPtr(id), + ReservationPatch: reservationPatch, + } +} + +// SetID : Allow user to set ID +func (_options *UpdateReservationOptions) SetID(id string) *UpdateReservationOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetReservationPatch : Allow user to set ReservationPatch +func (_options *UpdateReservationOptions) SetReservationPatch(reservationPatch map[string]interface{}) *UpdateReservationOptions { + _options.ReservationPatch = reservationPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateReservationOptions) SetHeaders(param map[string]string) *UpdateReservationOptions { + options.Headers = param + return options +} + // UpdateSecurityGroupOptions : The UpdateSecurityGroup options. type UpdateSecurityGroupOptions struct { // The security group identifier. @@ -77907,8 +79892,6 @@ func UnmarshalVPNGatewayConnectionLocalCIDRs(m map[string]json.RawMessage, resul } // VPNGatewayConnectionPatch : VPNGatewayConnectionPatch struct -// Models which "extend" this model: -// - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch type VPNGatewayConnectionPatch struct { // If set to false, the VPN gateway connection is shut down. AdminStateUp *bool `json:"admin_state_up,omitempty"` @@ -77943,14 +79926,6 @@ const ( VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" ) -func (*VPNGatewayConnectionPatch) isaVPNGatewayConnectionPatch() bool { - return true -} - -type VPNGatewayConnectionPatchIntf interface { - isaVPNGatewayConnectionPatch() bool -} - // UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(VPNGatewayConnectionPatch) @@ -84012,16 +85987,16 @@ type BareMetalServerNetworkInterfaceByHiperSocket struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` // The date and time that the bare metal server network interface was created. // // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) when its corresponding network attachment - // was created. + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // If `true`: @@ -84035,56 +86010,57 @@ type BareMetalServerNetworkInterfaceByHiperSocket struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` // The floating IPs associated with this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the floating IPs are associated with the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value // will be an empty string. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the MAC address is that of the attached virtual network - // interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. MacAddress *string `json:"mac_address" validate:"required"` // The name for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the name matches its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` // The bare metal server network interface port speed in Mbps. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the port speed is that of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. PortSpeed *int64 `json:"port_speed" validate:"required"` PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` @@ -84095,16 +86071,16 @@ type BareMetalServerNetworkInterfaceByHiperSocket struct { // The security groups targeting this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the security groups are associated with the attached - // virtual network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` // The status of the bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). Status *string `json:"status" validate:"required"` // The associated subnet. @@ -84113,8 +86089,9 @@ type BareMetalServerNetworkInterfaceByHiperSocket struct { // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. Type *string `json:"type" validate:"required"` // - `hipersocket`: a virtual network device that provides high-speed TCP/IP connectivity @@ -84133,7 +86110,7 @@ const ( // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( BareMetalServerNetworkInterfaceByHiperSocketStatusAvailableConst = "available" BareMetalServerNetworkInterfaceByHiperSocketStatusDeletingConst = "deleting" @@ -84145,8 +86122,9 @@ const ( // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( BareMetalServerNetworkInterfaceByHiperSocketTypePrimaryConst = "primary" BareMetalServerNetworkInterfaceByHiperSocketTypeSecondaryConst = "secondary" @@ -84240,16 +86218,16 @@ type BareMetalServerNetworkInterfaceByPci struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` // The date and time that the bare metal server network interface was created. // // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) when its corresponding network attachment - // was created. + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // If `true`: @@ -84263,56 +86241,57 @@ type BareMetalServerNetworkInterfaceByPci struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` // The floating IPs associated with this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the floating IPs are associated with the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value // will be an empty string. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the MAC address is that of the attached virtual network - // interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. MacAddress *string `json:"mac_address" validate:"required"` // The name for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the name matches its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` // The bare metal server network interface port speed in Mbps. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the port speed is that of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. PortSpeed *int64 `json:"port_speed" validate:"required"` PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` @@ -84323,16 +86302,16 @@ type BareMetalServerNetworkInterfaceByPci struct { // The security groups targeting this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the security groups are associated with the attached - // virtual network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` // The status of the bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). Status *string `json:"status" validate:"required"` // The associated subnet. @@ -84341,16 +86320,17 @@ type BareMetalServerNetworkInterfaceByPci struct { // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. Type *string `json:"type" validate:"required"` // The VLAN IDs allowed for `vlan` interfaces using this PCI interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN IDs match the `allow_vlans` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN IDs match the + // `allow_vlans` of the corresponding network attachment. AllowedVlans []int64 `json:"allowed_vlans" validate:"required"` // - `pci`: a physical PCI device which can only be created or deleted when the bare metal @@ -84372,7 +86352,7 @@ const ( // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( BareMetalServerNetworkInterfaceByPciStatusAvailableConst = "available" BareMetalServerNetworkInterfaceByPciStatusDeletingConst = "deleting" @@ -84384,8 +86364,9 @@ const ( // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( BareMetalServerNetworkInterfaceByPciTypePrimaryConst = "primary" BareMetalServerNetworkInterfaceByPciTypeSecondaryConst = "secondary" @@ -84486,16 +86467,16 @@ type BareMetalServerNetworkInterfaceByVlan struct { // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing" validate:"required"` // The date and time that the bare metal server network interface was created. // // If this bare metal server has network attachments, this network interface was created as a [read-only - // representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) when its corresponding network attachment - // was created. + // representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) when its corresponding + // network attachment was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` // If `true`: @@ -84509,56 +86490,57 @@ type BareMetalServerNetworkInterfaceByVlan struct { // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat" validate:"required"` // The floating IPs associated with this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the floating IPs are associated with the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the floating IPs are associated + // with the attached virtual network interface. FloatingIps []FloatingIPReference `json:"floating_ips" validate:"required"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The MAC address of this bare metal server network interface. If the MAC address has not yet been selected, the value // will be an empty string. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the MAC address is that of the attached virtual network - // interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the MAC address is that of the + // attached virtual network interface. MacAddress *string `json:"mac_address" validate:"required"` // The name for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the name matches its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the name matches its corresponding + // network attachment. Name *string `json:"name" validate:"required"` // The bare metal server network interface port speed in Mbps. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the port speed is that of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the port speed is that of its + // corresponding network attachment. PortSpeed *int64 `json:"port_speed" validate:"required"` PrimaryIP *ReservedIPReference `json:"primary_ip" validate:"required"` @@ -84569,16 +86551,16 @@ type BareMetalServerNetworkInterfaceByVlan struct { // The security groups targeting this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the security groups are associated with the attached - // virtual network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the security groups are associated + // with the attached virtual network interface. SecurityGroups []SecurityGroupReference `json:"security_groups" validate:"required"` // The status of the bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from - // them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). + // them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). Status *string `json:"status" validate:"required"` // The associated subnet. @@ -84587,8 +86569,9 @@ type BareMetalServerNetworkInterfaceByVlan struct { // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the type is that of its + // corresponding network attachment. Type *string `json:"type" validate:"required"` // Indicates if the data path for the network interface can float to another bare metal server. Can only be `true` for @@ -84603,9 +86586,9 @@ type BareMetalServerNetworkInterfaceByVlan struct { // this network interface's `vlan`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the value of this property matches that of the - // `allow_to_float` property of the corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. AllowInterfaceToFloat *bool `json:"allow_interface_to_float" validate:"required"` // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array @@ -84618,9 +86601,9 @@ type BareMetalServerNetworkInterfaceByVlan struct { // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. Vlan *int64 `json:"vlan" validate:"required"` } @@ -84635,7 +86618,7 @@ const ( // // If this bare metal server has network attachments, this network interface is a read-only representation of its // corresponding network attachment and its attached virtual network interface, and the status is [computed from -// them](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients). +// them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients). const ( BareMetalServerNetworkInterfaceByVlanStatusAvailableConst = "available" BareMetalServerNetworkInterfaceByVlanStatusDeletingConst = "deleting" @@ -84647,8 +86630,9 @@ const ( // The bare metal server network interface type. // // If this bare metal server has network attachments, this network interface is a -// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network -// attachment and its attached virtual network interface, and the type is that of its corresponding network attachment. +// [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its +// corresponding network attachment and its attached virtual network interface, and the type is that of its +// corresponding network attachment. const ( BareMetalServerNetworkInterfaceByVlanTypePrimaryConst = "primary" BareMetalServerNetworkInterfaceByVlanTypeSecondaryConst = "secondary" @@ -84753,9 +86737,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHi // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // If `true`: @@ -84769,9 +86753,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHi // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` // The name for this bare metal server network interface. The name must not be used by another network interface on the @@ -84862,9 +86846,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPc // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // If `true`: @@ -84878,9 +86862,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPc // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` // The name for this bare metal server network interface. The name must not be used by another network interface on the @@ -84984,9 +86968,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVl // Indicates whether source IP spoofing is allowed on this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and source IP spoofing is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and source IP spoofing is managed on + // the attached virtual network interface. AllowIPSpoofing *bool `json:"allow_ip_spoofing,omitempty"` // If `true`: @@ -85000,9 +86984,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVl // - `interface_type` must not be `hipersocket`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and infrastructure NAT is managed on the attached virtual - // network interface. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and infrastructure NAT is managed on + // the attached virtual network interface. EnableInfrastructureNat *bool `json:"enable_infrastructure_nat,omitempty"` // The name for this bare metal server network interface. The name must not be used by another network interface on the @@ -85036,9 +87020,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVl // this network interface's `vlan`. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the value of this property matches that of the - // `allow_to_float` property of the corresponding network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the value of this property matches + // that of the `allow_to_float` property of the corresponding network attachment. AllowInterfaceToFloat *bool `json:"allow_interface_to_float,omitempty"` // - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array @@ -85052,9 +87036,9 @@ type BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVl // The VLAN ID used in the IEEE 802.1Q tag present in all traffic on this interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of the corresponding - // network attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the VLAN ID matches the `vlan` of + // the corresponding network attachment. Vlan *int64 `json:"vlan" validate:"required"` } @@ -87961,16 +89945,16 @@ type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity struct { // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` } @@ -88011,16 +89995,16 @@ type FloatingIPTargetPatchNetworkInterfaceIdentity struct { // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` } @@ -88110,16 +90094,16 @@ type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity struct { // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` } @@ -88160,16 +90144,16 @@ type FloatingIPTargetPrototypeNetworkInterfaceIdentity struct { // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` } @@ -88260,16 +90244,16 @@ type FloatingIPTargetBareMetalServerNetworkInterfaceReference struct { // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this bare metal server network interface. @@ -88332,16 +90316,16 @@ type FloatingIPTargetNetworkInterfaceReference struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this instance network interface. @@ -88635,16 +90619,16 @@ type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity struct { // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id,omitempty"` // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href,omitempty"` } @@ -88956,16 +90940,16 @@ type FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this instance network interface. @@ -92697,6 +94681,8 @@ type InstancePrototypeInstanceByCatalogOffering struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -92704,6 +94690,8 @@ type InstancePrototypeInstanceByCatalogOffering struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -92737,12 +94725,6 @@ type InstancePrototypeInstanceByCatalogOffering struct { // to IAM policies. CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -92751,6 +94733,12 @@ type InstancePrototypeInstanceByCatalogOffering struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototypeInstanceByCatalogOffering() bool { @@ -92797,6 +94785,10 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -92825,23 +94817,23 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -92888,6 +94880,8 @@ type InstancePrototypeInstanceByImage struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -92895,6 +94889,8 @@ type InstancePrototypeInstanceByImage struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -92921,12 +94917,6 @@ type InstancePrototypeInstanceByImage struct { // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -92935,6 +94925,12 @@ type InstancePrototypeInstanceByImage struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstancePrototypeInstanceByImage) isaInstancePrototypeInstanceByImage() bool { @@ -92981,6 +94977,10 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -93009,23 +95009,23 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -93072,6 +95072,8 @@ type InstancePrototypeInstanceBySourceSnapshot struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -93079,6 +95081,8 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -93102,12 +95106,6 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // The boot volume attachment to create for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -93116,6 +95114,12 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototypeInstanceBySourceSnapshot() bool { @@ -93162,6 +95166,10 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -93186,23 +95194,23 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -93252,6 +95260,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -93259,6 +95269,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -93359,6 +95371,10 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -93458,6 +95474,8 @@ type InstancePrototypeInstanceByVolume struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -93465,6 +95483,8 @@ type InstancePrototypeInstanceByVolume struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -93488,12 +95508,6 @@ type InstancePrototypeInstanceByVolume struct { // The boot volume attachment for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -93502,6 +95516,12 @@ type InstancePrototypeInstanceByVolume struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstancePrototypeInstanceByVolume) isaInstancePrototypeInstanceByVolume() bool { @@ -93548,6 +95568,10 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -93572,23 +95596,23 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -93726,6 +95750,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -93733,6 +95759,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -93766,12 +95794,6 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // to IAM policies. CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -93780,6 +95802,12 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { @@ -93826,6 +95854,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -93854,23 +95886,23 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -93915,6 +95947,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -93922,6 +95956,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -93948,12 +95984,6 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -93962,6 +95992,12 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { @@ -94008,6 +96044,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -94036,23 +96076,23 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -94097,6 +96137,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -94104,6 +96146,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -94127,12 +96171,6 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // The boot volume attachment to create for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -94141,6 +96179,12 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { @@ -94187,6 +96231,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -94211,23 +96259,23 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -94269,6 +96317,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -94276,6 +96326,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -94376,6 +96428,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -94484,6 +96540,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -94491,6 +96549,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -94525,12 +96585,6 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // to IAM policies. CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -94539,6 +96593,12 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { @@ -94601,6 +96661,10 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -94629,23 +96693,23 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -94701,6 +96765,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -94708,6 +96774,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -94735,12 +96803,6 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -94749,6 +96811,12 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` + + // The additional instance network interfaces to create. + NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { @@ -94811,6 +96879,10 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -94839,23 +96911,23 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) if err != nil { return } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -94911,6 +96983,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -94918,6 +96992,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -94951,11 +97027,11 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // The primary network attachment to create for the virtual server instance. PrimaryNetworkAttachment *InstanceNetworkAttachmentPrototype `json:"primary_network_attachment,omitempty"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` + + // The primary instance network interface to create. + PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface,omitempty"` } func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { @@ -95018,6 +97094,10 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -95054,11 +97134,11 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) if err != nil { return } @@ -98505,6 +100585,99 @@ func UnmarshalRegionIdentityByName(m map[string]json.RawMessage, result interfac return } +// ReservationIdentityByCRN : ReservationIdentityByCRN struct +// This model "extends" ReservationIdentity +type ReservationIdentityByCRN struct { + // The CRN for this reservation. + CRN *string `json:"crn" validate:"required"` +} + +// NewReservationIdentityByCRN : Instantiate ReservationIdentityByCRN (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByCRN(crn string) (_model *ReservationIdentityByCRN, err error) { + _model = &ReservationIdentityByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservationIdentityByCRN) isaReservationIdentity() bool { + return true +} + +// UnmarshalReservationIdentityByCRN unmarshals an instance of ReservationIdentityByCRN from the specified map of raw messages. +func UnmarshalReservationIdentityByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationIdentityByHref : ReservationIdentityByHref struct +// This model "extends" ReservationIdentity +type ReservationIdentityByHref struct { + // The URL for this reservation. + Href *string `json:"href" validate:"required"` +} + +// NewReservationIdentityByHref : Instantiate ReservationIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByHref(href string) (_model *ReservationIdentityByHref, err error) { + _model = &ReservationIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservationIdentityByHref) isaReservationIdentity() bool { + return true +} + +// UnmarshalReservationIdentityByHref unmarshals an instance of ReservationIdentityByHref from the specified map of raw messages. +func UnmarshalReservationIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReservationIdentityByID : ReservationIdentityByID struct +// This model "extends" ReservationIdentity +type ReservationIdentityByID struct { + // The unique identifier for this reservation. + ID *string `json:"id" validate:"required"` +} + +// NewReservationIdentityByID : Instantiate ReservationIdentityByID (Generic Model Constructor) +func (*VpcV1) NewReservationIdentityByID(id string) (_model *ReservationIdentityByID, err error) { + _model = &ReservationIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +func (*ReservationIdentityByID) isaReservationIdentity() bool { + return true +} + +// UnmarshalReservationIdentityByID unmarshals an instance of ReservationIdentityByID from the specified map of raw messages. +func UnmarshalReservationIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ReservationIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ReservedIPTargetPrototypeEndpointGatewayIdentity : ReservedIPTargetPrototypeEndpointGatewayIdentity struct // Models which "extend" this model: // - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByID @@ -98613,16 +100786,16 @@ type ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext struc // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this bare metal server network interface. @@ -98850,16 +101023,16 @@ type ReservedIPTargetNetworkInterfaceReferenceTargetContext struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this instance network interface. @@ -100560,16 +102733,16 @@ type SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetC // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this bare metal server network interface. @@ -100754,16 +102927,16 @@ type SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext struct { // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` // The name for this instance network interface. @@ -103465,90 +105638,6 @@ func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m return } -// VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch : VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch struct -// This model "extends" VPNGatewayConnectionPatch -type VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch struct { - // If set to false, the VPN gateway connection is shut down. - AdminStateUp *bool `json:"admin_state_up,omitempty"` - - DeadPeerDetection *VPNGatewayConnectionDpdPatch `json:"dead_peer_detection,omitempty"` - - IkePolicy VPNGatewayConnectionIkePolicyPatchIntf `json:"ike_policy,omitempty"` - - IpsecPolicy VPNGatewayConnectionIPsecPolicyPatchIntf `json:"ipsec_policy,omitempty"` - - // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. - Name *string `json:"name,omitempty"` - - // The IP address of the peer VPN gateway. - PeerAddress *string `json:"peer_address,omitempty"` - - // The pre-shared key. - Psk *string `json:"psk,omitempty"` - - // Routing protocols are disabled for this VPN gateway connection. - RoutingProtocol *string `json:"routing_protocol,omitempty"` -} - -// Constants associated with the VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.RoutingProtocol property. -// Routing protocols are disabled for this VPN gateway connection. -const ( - VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatchRoutingProtocolNoneConst = "none" -) - -func (*VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) isaVPNGatewayConnectionPatch() bool { - return true -} - -// UnmarshalVPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch unmarshals an instance of VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch from the specified map of raw messages. -func UnmarshalVPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) - err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) - if err != nil { - return - } - err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPatch) - if err != nil { - return - } - err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPatch) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "peer_address", &obj.PeerAddress) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AsPatch returns a generic map representation of the VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch -func (vpnGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch *VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(vpnGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) - } - return -} - // VPNGatewayConnectionPolicyMode : VPNGatewayConnectionPolicyMode struct // This model "extends" VPNGatewayConnection type VPNGatewayConnectionPolicyMode struct { @@ -105971,8 +108060,8 @@ type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServer // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` } @@ -106010,9 +108099,9 @@ type FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServer // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` } @@ -106050,8 +108139,8 @@ type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` } @@ -106089,9 +108178,9 @@ type FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByID s // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` } @@ -106234,8 +108323,8 @@ type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalSe // The URL for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` } @@ -106273,9 +108362,9 @@ type FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalSe // The unique identifier for this bare metal server network interface. // // If this bare metal server has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` } @@ -106313,8 +108402,8 @@ type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityBy // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` } @@ -106352,9 +108441,9 @@ type FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityBy // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` } @@ -106672,8 +108761,8 @@ type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIden // The URL for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment. Href *string `json:"href" validate:"required"` } @@ -106711,9 +108800,9 @@ type FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIden // The unique identifier for this instance network interface. // // If this instance has network attachments, this network interface is a - // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vni-old-api-clients) of its corresponding network - // attachment and its attached virtual network interface, and the identifier is that of the corresponding network - // attachment. + // [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + // corresponding network attachment and its attached virtual network interface, and the identifier is that of the + // corresponding network attachment. ID *string `json:"id" validate:"required"` } @@ -108251,6 +110340,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -108258,6 +110349,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -108283,12 +110376,6 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -108300,10 +110387,9 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance } // NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment{ CatalogOffering: catalogOffering, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -108350,6 +110436,10 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -108378,14 +110468,6 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -108438,6 +110520,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -108445,6 +110529,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -108530,6 +110616,10 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -108610,6 +110700,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -108617,6 +110709,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -108643,12 +110737,6 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -108660,10 +110748,9 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment } // NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image ImageIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment{ Image: image, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -108710,6 +110797,10 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAt if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -108738,14 +110829,6 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAt if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -108798,6 +110881,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface s Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -108805,6 +110890,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface s // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -108891,6 +110978,10 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkIn if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -108971,6 +111062,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -108978,6 +111071,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -109001,12 +111096,6 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The boot volume attachment to create for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -109018,10 +111107,9 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy } // NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment{ BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -109068,6 +111156,10 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -109092,14 +111184,6 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -109152,6 +111236,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -109159,6 +111245,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -109242,6 +111330,10 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -109318,6 +111410,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -109325,6 +111419,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -109348,12 +111444,6 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen // The boot volume attachment for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext `json:"boot_volume_attachment" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -109365,10 +111455,9 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen } // NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment{ BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -109415,6 +111504,10 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -109439,14 +111532,6 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -109499,6 +111584,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -109506,6 +111593,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -109589,6 +111678,10 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -109663,6 +111756,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -109670,6 +111765,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -109695,12 +111792,6 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -109712,10 +111803,9 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB } // NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment{ CatalogOffering: catalogOffering, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -109762,6 +111852,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -109790,14 +111884,6 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -109848,6 +111934,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -109855,6 +111943,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -109940,6 +112030,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -110018,6 +112112,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -110025,6 +112121,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -110051,12 +112149,6 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -110068,10 +112160,9 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst } // NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image ImageIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment{ Image: image, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -110118,6 +112209,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -110146,14 +112241,6 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -110204,6 +112291,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -110211,6 +112300,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -110297,6 +112388,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -110375,6 +112470,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -110382,6 +112479,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -110405,12 +112504,6 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The boot volume attachment to create for the virtual server instance. BootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext `json:"boot_volume_attachment" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -110422,10 +112515,9 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy } // NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) -func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, primaryNetworkInterface *NetworkInterfacePrototype, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment, err error) { +func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment{ BootVolumeAttachment: bootVolumeAttachment, - PrimaryNetworkInterface: primaryNetworkInterface, Zone: zone, PrimaryNetworkAttachment: primaryNetworkAttachment, } @@ -110472,6 +112564,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -110496,14 +112592,6 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -110554,6 +112642,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy Name *string `json:"name,omitempty"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -110561,6 +112651,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` // The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in @@ -110644,6 +112736,10 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupIdentity) if err != nil { return @@ -110729,6 +112825,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -110736,6 +112834,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -110762,12 +112862,6 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC CatalogOffering InstanceCatalogOfferingPrototypeIntf `json:"catalog_offering" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -110833,6 +112927,10 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -110861,14 +112959,6 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -110930,6 +113020,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -110937,6 +113029,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -111028,6 +113122,10 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -111117,6 +113215,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -111124,6 +113224,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -111151,12 +113253,6 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The image to use when provisioning the virtual server instance. Image ImageIdentityIntf `json:"image" validate:"required"` - // The additional instance network interfaces to create. - NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -111222,6 +113318,10 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -111250,14 +113350,6 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm if err != nil { return } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -111319,6 +113411,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -111326,6 +113420,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -111418,6 +113514,10 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -111507,6 +113607,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -111514,6 +113616,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -111541,9 +113645,6 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The additional instance network interfaces to create. NetworkInterfaces []NetworkInterfacePrototype `json:"network_interfaces,omitempty"` - // The primary instance network interface to create. - PrimaryNetworkInterface *NetworkInterfacePrototype `json:"primary_network_interface" validate:"required"` - // The zone this virtual server instance will reside in. Zone ZoneIdentityIntf `json:"zone" validate:"required"` @@ -111609,6 +113710,10 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -111637,10 +113742,6 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns if err != nil { return } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - return - } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { return @@ -111702,6 +113803,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo Name *string `json:"name" validate:"required"` // The placement restrictions to use for the virtual server instance. + // + // If specified, `reservation_affinity.policy` must be `disabled`. PlacementTarget InstancePlacementTargetPrototypeIntf `json:"placement_target,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. @@ -111709,6 +113812,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` + ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` + // The resource group for this instance template. ResourceGroup *ResourceGroupReference `json:"resource_group" validate:"required"` @@ -111804,6 +113909,10 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns if err != nil { return } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + return + } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { return @@ -115300,6 +117409,91 @@ func (pager *InstanceGroupMembershipsPager) GetAll() (allItems []InstanceGroupMe return pager.GetAllWithContext(context.Background()) } +// ReservationsPager can be used to simplify the use of the "ListReservations" method. +type ReservationsPager struct { + hasNext bool + options *ListReservationsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewReservationsPager returns a new ReservationsPager instance. +func (vpc *VpcV1) NewReservationsPager(options *ListReservationsOptions) (pager *ReservationsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = fmt.Errorf("the 'options.Start' field should not be set") + return + } + + var optionsCopy ListReservationsOptions = *options + pager = &ReservationsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *ReservationsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *ReservationsPager) GetNextWithContext(ctx context.Context) (page []Reservation, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListReservationsWithContext(ctx, pager.options) + if err != nil { + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + err = fmt.Errorf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Reservations + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *ReservationsPager) GetAllWithContext(ctx context.Context) (allItems []Reservation, err error) { + for pager.HasNext() { + var nextPage []Reservation + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *ReservationsPager) GetNext() (page []Reservation, err error) { + return pager.GetNextWithContext(context.Background()) +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *ReservationsPager) GetAll() (allItems []Reservation, err error) { + return pager.GetAllWithContext(context.Background()) +} + // DedicatedHostGroupsPager can be used to simplify the use of the "ListDedicatedHostGroups" method. type DedicatedHostGroupsPager struct { hasNext bool diff --git a/go.mod b/go.mod index 9124601aae..117a7eb263 100644 --- a/go.mod +++ b/go.mod @@ -244,4 +244,4 @@ exclude ( k8s.io/client-go v12.0.0+incompatible ) -replace github.com/IBM/vpc-go-sdk v0.47.0 => ./common/github.com/IBM/vpc-go-sdk \ No newline at end of file +replace github.com/IBM/vpc-go-sdk v0.48.0 => ./common/github.com/IBM/vpc-go-sdk \ No newline at end of file diff --git a/ibm/service/iampolicy/resource_ibm_iam_user_policy_test.go b/ibm/service/iampolicy/resource_ibm_iam_user_policy_test.go index 91b62395a5..ce861ce2f4 100644 --- a/ibm/service/iampolicy/resource_ibm_iam_user_policy_test.go +++ b/ibm/service/iampolicy/resource_ibm_iam_user_policy_test.go @@ -226,7 +226,6 @@ func TestAccIBMIAMUserPolicy_With_Resource_Attributes_Without_Wildcard(t *testin }) } - func TestAccIBMIAMUserPolicy_account_management(t *testing.T) { var conf iampolicymanagementv1.V2PolicyTemplateMetaData name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100)) @@ -848,7 +847,6 @@ func testAccCheckIBMIAMUserPolicyResourceAttributesWithoutWildcard() string { `, acc.IAMUser) } - func testAccCheckIBMIAMUserPolicyResourceAttributesUpdate() string { return fmt.Sprintf(` resource "ibm_iam_user_policy" "policy" {