diff --git a/.gitignore b/.gitignore index 2ce5530..812ba14 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ # rspec failure tracking .rspec_status + +*.env +.env \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 172766e..bc672f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: ruby cache: bundler sudo: required +dist: focal rvm: - 2.5.1 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ee5e3d1 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +# This makefile is used to make it easier to run the tests. + +test-unit: + bundle exec rake test:unit + +test-example: + bundle exec rake test:examples + +test-int: + bundle exec rake test:integration \ No newline at end of file diff --git a/README.md b/README.md index 08d58a0..9074b84 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Setting up and using the API client is simple, just pass in your authenticator o # Pass the authenticator into the VpcV1 service vpc_v1 = IbmVpc::VpcV1.new( - version: "2022-03-29" # Will default to the latest version if not specified + version: "2022-09-13" # Will default to the latest version if not specified authenticator: authenticator ) diff --git a/Rakefile b/Rakefile index f4e1331..4391f80 100644 --- a/Rakefile +++ b/Rakefile @@ -28,6 +28,16 @@ namespace :test do t.warning = true t.deps = %i[dotenv rubocop] end + + Rake::TestTask.new do |t| + t.name = "examples" + t.description = "Run example tests (put credentials in a .env file)" + t.libs << "test" + t.test_files = FileList["test/examples/*.rb"] + t.verbose = true + t.warning = true + t.deps = %i[dotenv rubocop] + end end desc "Run unit & integration tests" diff --git a/lib/ibm_vpc/vpc_v1.rb b/lib/ibm_vpc/vpc_v1.rb index 64d83fb..253b5d2 100644 --- a/lib/ibm_vpc/vpc_v1.rb +++ b/lib/ibm_vpc/vpc_v1.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# (C) Copyright IBM Corp. 2020, 2021, 2022. +# (C) Copyright IBM Corp. 2020, 2021, 2022, 2023. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# IBM OpenAPI SDK Code Generator Version: 3.50.0-af9e48c4-20220523-163800 +# IBM OpenAPI SDK Code Generator Version: 3.63.0-5dae26c1-20230111-193039 # # The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically # provision and manage virtual server instances, along with subnets, volumes, load @@ -33,7 +33,7 @@ class VpcV1 < IBMCloudSdkCore::BaseService include Concurrent::Async DEFAULT_SERVICE_NAME = "vpc" DEFAULT_SERVICE_URL = "https://us-south.iaas.cloud.ibm.com/v1" - DEFAULT_SERVICE_VERSION = "2022-03-29" + DEFAULT_SERVICE_VERSION = "2022-09-13" attr_accessor :version attr_accessor :generation ## @@ -42,7 +42,7 @@ class VpcV1 < IBMCloudSdkCore::BaseService # # @param args [Hash] The args to initialize with # @option args version [String] The API version, in format `YYYY-MM-DD`. For the API behavior documented here, - # specify any date between `2022-07-12` and today's date (UTC). + # specify any date between `2022-09-13` and today's date (UTC). # @option args service_url [String] The base service URL to use when contacting the service. # The base service_url may differ between IBM Cloud regions. # @option args authenticator [Object] The Authenticator instance to be configured for this service. @@ -121,9 +121,10 @@ def list_vpcs(start: nil, limit: nil, resource_group_id: nil, classic_access: ni # This request creates a new VPC from a VPC prototype object. The prototype object # is structured in the same way as a retrieved VPC, and contains the information # necessary to create the new VPC. - # @param address_prefix_management [String] Indicates whether a default address prefix will be automatically created for each - # zone in this VPC. If `manual`, this VPC will be created with no default address - # prefixes. + # @param address_prefix_management [String] Indicates whether a [default address + # prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) + # will be automatically created for each zone in this VPC. If `manual`, this VPC + # will be created with no default address prefixes. # # Since address prefixes are managed identically regardless of whether they were # automatically created, the value is not preserved as a VPC property. @@ -131,8 +132,8 @@ def list_vpcs(start: nil, limit: nil, resource_group_id: nil, classic_access: ni # this VPC's resources will have private network connectivity to the account's # Classic Infrastructure resources. Only one VPC, per region, may be connected in # this way. This value is set at creation and subsequently immutable. - # @param name [String] The unique user-defined name for this VPC. If unspecified, the name will be a - # hyphenated list of randomly-selected words. + # @param name [String] The name for this VPC. The name must not be used by another VPC in the region. If + # unspecified, the name will be a hyphenated list of randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -175,10 +176,10 @@ def create_vpc(address_prefix_management: nil, classic_access: nil, name: nil, r # @!method delete_vpc(id:) # Delete a VPC. # This request deletes a VPC. This operation cannot be reversed. For this request to - # succeed, the VPC must not contain any instances, subnets, or public gateways. All - # security groups and network ACLs associated with the VPC are automatically - # deleted. All flow log collectors with `auto_delete` set to `true` targeting the - # VPC or any resource in the VPC are automatically deleted. + # succeed, the VPC must not contain any instances, subnets, public gateways, or + # endpoint gateways. All security groups and network ACLs associated with the VPC + # are automatically deleted. All flow log collectors with `auto_delete` set to + # `true` targeting the VPC or any resource in the VPC are automatically deleted. # @param id [String] The VPC identifier. # @return [nil] def delete_vpc(id:) @@ -329,8 +330,7 @@ def get_vpc_default_network_acl(id:) # Retrieve a VPC's default routing table. # This request retrieves the default routing table for the VPC specified by the # identifier in the URL. The default routing table is associated with any subnets in - # the VPC which have not been explicitly associated with a user-defined routing - # table. + # the VPC which have not been explicitly associated with another routing table. # @param id [String] The VPC identifier. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def get_vpc_default_routing_table(id:) @@ -446,9 +446,10 @@ def list_vpc_address_prefixes(vpc_id:, start: nil, limit: nil) # object is structured in the same way as a retrieved prefix, and contains the # information necessary to create the new prefix. # @param vpc_id [String] The VPC identifier. - # @param cidr [String] The IPv4 range of the address prefix, expressed in CIDR format. The request must - # not overlap with any existing address prefixes in the VPC or any of the following + # @param cidr [String] The IPv4 range of the address prefix, expressed in CIDR format. The range must not + # overlap with any existing address prefixes in the VPC or any of the following # reserved address ranges: + # # - `127.0.0.0/8` (IPv4 loopback addresses) # - `161.26.0.0/16` (IBM services) # - `166.8.0.0/14` (Cloud Service Endpoints) @@ -460,9 +461,9 @@ def list_vpc_address_prefixes(vpc_id:, start: nil, limit: nil) # @param zone [ZoneIdentity] The zone this address prefix will reside in. # @param is_default [Boolean] Indicates whether this will be the default address prefix for this zone in this # VPC. If `true`, the VPC must not have a default address prefix for this zone. - # @param name [String] The user-defined name for this address prefix. Names must be unique within the VPC - # the address prefix resides in. If unspecified, the name will be a hyphenated list - # of randomly-selected words. + # @param name [String] The name for this address prefix. The name must not be used by another address + # prefix for the VPC. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def create_vpc_address_prefix(vpc_id:, cidr:, zone:, is_default: nil, name: nil) raise ArgumentError.new("version must be provided") if version.nil? @@ -684,20 +685,19 @@ def list_vpc_routes(vpc_id:, zone_name: nil, start: nil, limit: nil) # @param vpc_id [String] The VPC identifier. # @param destination [String] The destination of the route. At most two routes per `zone` in a table can have # the same destination, and only if both routes have an `action` of `deliver` and - # the - # `next_hop` is an IP address. + # the `next_hop` is an IP address. # @param zone [ZoneIdentity] The zone to apply the route to. (Traffic from subnets in this zone will be # subject to this route.). # @param action [String] The action to perform with a packet matching the route: - # - `delegate`: delegate to the system's built-in routes - # - `delegate_vpc`: delegate to the system's built-in routes, ignoring - # Internet-bound - # routes + # - `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. - # @param name [String] The user-defined name for this route. If unspecified, the name will be a - # hyphenated list of randomly-selected words. Names must be unique within the VPC - # routing table the route resides in. + # @param name [String] The name for this route. The name must not be used by another route in the routing + # table. Names starting with `ibm-` are reserved for system-provided routes, and are + # not allowed. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param next_hop [RoutePrototypeNextHop] If `action` is `deliver`, the next hop that packets will be delivered to. For # other `action` # values, it must be omitted or specified as `0.0.0.0`. @@ -870,12 +870,12 @@ def update_vpc_route(vpc_id:, id:, route_patch:) ## # @!method list_vpc_routing_tables(vpc_id:, start: nil, limit: nil, is_default: nil) # List all routing tables for a VPC. - # This request lists all user-defined routing tables for a VPC. Each subnet in a - # VPC is associated with a routing table, which controls delivery of packets sent on - # that subnet according to the action of the most specific matching route in the - # table. If multiple equally-specific routes exist, traffic will be distributed - # across them. If no routes match, delivery will be controlled by the system's - # built-in routes. + # This request lists all routing tables for a VPC. Each subnet in a VPC is + # associated with a routing table, which controls delivery of packets sent on that + # subnet according to the action of the most specific matching route in the table. + # If multiple equally-specific routes exist, traffic will be distributed across + # them. If no routes match, delivery will be controlled by the system's built-in + # routes. # @param vpc_id [String] The VPC identifier. # @param start [String] A server-provided token determining what resource to start the page on. # @param limit [Fixnum] The number of resources to return on a page. @@ -914,48 +914,59 @@ def list_vpc_routing_tables(vpc_id:, start: nil, limit: nil, is_default: nil) end ## - # @!method create_vpc_routing_table(vpc_id:, accept_routes_from: nil, name: nil, route_direct_link_ingress: nil, route_transit_gateway_ingress: nil, route_vpc_zone_ingress: nil, routes: nil) + # @!method create_vpc_routing_table(vpc_id:, accept_routes_from: nil, name: nil, route_direct_link_ingress: nil, route_internet_ingress: nil, route_transit_gateway_ingress: nil, route_vpc_zone_ingress: nil, routes: nil) # Create a routing table for a VPC. - # This request creates a user-defined routing table from a routing table prototype - # object. The prototype object is structured in the same way as a retrieved routing - # table, and contains the information necessary to create the new routing table. + # This request creates a routing table from a routing table prototype object. The + # prototype object is structured in the same way as a retrieved routing table, and + # contains the information necessary to create the new routing table. # @param vpc_id [String] The VPC identifier. # @param accept_routes_from [Array[ResourceFilter]] The filters specifying the resources that may create routes in this routing table. # # At present, only the `resource_type` filter is permitted, and only the # `vpn_server` value is supported, but filter support is expected to expand in the # future. - # @param name [String] The user-defined name for this routing table. Names must be unique within the VPC - # the routing table resides in. If unspecified, the name will be a hyphenated list - # of randomly-selected words. + # @param name [String] The name for this routing table. The name must not be used by another routing + # table in the VPC. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param route_direct_link_ingress [Boolean] If set to `true`, this routing table will be used to route traffic that originates - # from [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. For this to - # succeed, the VPC must not already have a routing table with this property set to - # `true`. + # from [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. The VPC must not + # already have a routing table with this property set to `true`. # # Incoming traffic will be routed according to the routing table with one exception: # routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` # is an IP address bound to a network interface on a subnet in the route's `zone`. # Therefore, if an incoming packet matches a route with a `next_hop` of an # internet-bound IP address or a VPN gateway connection, the packet will be dropped. + # + # If [Classic + # Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) + # is enabled for this VPC, and this property is set to `true`, its incoming traffic + # will also be routed according to this routing table. + # @param route_internet_ingress [Boolean] If set to `true`, this routing table will be used to route traffic that originates + # from the internet. For this to succeed, the VPC must not already have a routing + # table with this property set to `true`. + # + # Incoming traffic will be routed according to the routing table with two + # exceptions: + # - Traffic destined for IP addresses associated with public gateways will not be + # subject to routes in this routing table. + # - Routes with an action of deliver are treated as drop unless the `next_hop` is an + # IP address bound to a network interface on a subnet in the route's `zone`. + # Therefore, if an incoming packet matches a route with a `next_hop` of an + # internet-bound IP address or a VPN gateway connection, the packet will be + # dropped. # @param route_transit_gateway_ingress [Boolean] If set to `true`, this routing table will be used to route traffic that originates - # from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. - # For this to succeed, the VPC must not already have a routing table with this - # property set to `true`. + # from [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + # The VPC must not already have a routing table with this property set to `true`. # # Incoming traffic will be routed according to the routing table with one exception: # routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` # is an IP address bound to a network interface on a subnet in the route's `zone`. # Therefore, if an incoming packet matches a route with a `next_hop` of an # internet-bound IP address or a VPN gateway connection, the packet will be dropped. - # - # If [Classic - # Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) - # is enabled for this VPC, and this property is set to `true`, its incoming traffic - # will also be routed according to this routing table. # @param route_vpc_zone_ingress [Boolean] If set to `true`, this routing table will be used to route traffic that originates - # from subnets in other zones in this VPC. For this to succeed, the VPC must not - # already have a routing table with this property set to `true`. + # from subnets in other zones in this VPC. The VPC must not already have a routing + # table with this property set to `true`. # # Incoming traffic will be routed according to the routing table with one exception: # routes with an `action` of `deliver` are treated as `drop` unless the `next_hop` @@ -965,7 +976,7 @@ def list_vpc_routing_tables(vpc_id:, start: nil, limit: nil, is_default: nil) # @param routes [Array[RoutePrototype]] The prototype objects for routes to create for this routing table. If unspecified, # the routing table will be created with no routes. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def create_vpc_routing_table(vpc_id:, accept_routes_from: nil, name: nil, route_direct_link_ingress: nil, route_transit_gateway_ingress: nil, route_vpc_zone_ingress: nil, routes: nil) + def create_vpc_routing_table(vpc_id:, accept_routes_from: nil, name: nil, route_direct_link_ingress: nil, route_internet_ingress: nil, route_transit_gateway_ingress: nil, route_vpc_zone_ingress: nil, routes: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -986,6 +997,7 @@ def create_vpc_routing_table(vpc_id:, accept_routes_from: nil, name: nil, route_ "accept_routes_from" => accept_routes_from, "name" => name, "route_direct_link_ingress" => route_direct_link_ingress, + "route_internet_ingress" => route_internet_ingress, "route_transit_gateway_ingress" => route_transit_gateway_ingress, "route_vpc_zone_ingress" => route_vpc_zone_ingress, "routes" => routes @@ -1193,20 +1205,19 @@ def list_vpc_routing_table_routes(vpc_id:, routing_table_id:, start: nil, limit: # @param routing_table_id [String] The routing table identifier. # @param destination [String] The destination of the route. At most two routes per `zone` in a table can have # the same destination, and only if both routes have an `action` of `deliver` and - # the - # `next_hop` is an IP address. + # the `next_hop` is an IP address. # @param zone [ZoneIdentity] The zone to apply the route to. (Traffic from subnets in this zone will be # subject to this route.). # @param action [String] The action to perform with a packet matching the route: - # - `delegate`: delegate to the system's built-in routes - # - `delegate_vpc`: delegate to the system's built-in routes, ignoring - # Internet-bound - # routes + # - `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. - # @param name [String] The user-defined name for this route. If unspecified, the name will be a - # hyphenated list of randomly-selected words. Names must be unique within the VPC - # routing table the route resides in. + # @param name [String] The name for this route. The name must not be used by another route in the routing + # table. Names starting with `ibm-` are reserved for system-provided routes, and are + # not allowed. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param next_hop [RoutePrototypeNextHop] If `action` is `deliver`, the next hop that packets will be delivered to. For # other `action` # values, it must be omitted or specified as `0.0.0.0`. @@ -1258,7 +1269,8 @@ def create_vpc_routing_table_route(vpc_id:, routing_table_id:, destination:, zon ## # @!method delete_vpc_routing_table_route(vpc_id:, routing_table_id:, id:) # Delete a VPC routing table route. - # This request deletes a VPC route. This operation cannot be reversed. + # This request deletes a VPC route. This operation cannot be reversed. Only VPC + # routes with an `origin` of `user` are allowed to be deleted. # @param vpc_id [String] The VPC identifier. # @param routing_table_id [String] The routing table identifier. # @param id [String] The VPC routing table route identifier. @@ -1343,7 +1355,8 @@ def get_vpc_routing_table_route(vpc_id:, routing_table_id:, id:) # Update a VPC routing table route. # This request updates a VPC route with the information provided in a route patch # object. The patch object is structured in the same way as a retrieved VPC route - # and needs to contain only the information to be updated. + # and needs to contain only the information to be updated. Only VPC routes with an + # `origin` of `user` are allowed to be updated. # @param vpc_id [String] The VPC identifier. # @param routing_table_id [String] The routing table identifier. # @param id [String] The VPC routing table route identifier. @@ -1637,10 +1650,9 @@ def get_subnet_network_acl(id:) ## # @!method replace_subnet_network_acl(id:, network_acl_identity:) - # Attach a network ACL to a subnet. - # This request attaches the network ACL, specified in the request body, to the - # subnet specified by the subnet identifier in the URL. This replaces the existing - # network ACL on the subnet. + # Replace the network ACL for a subnet. + # This request replaces the existing network ACL for a subnet with the network ACL + # specified in the request body. # @param id [String] The subnet identifier. # @param network_acl_identity [NetworkACLIdentity] The network ACL identity. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -1833,10 +1845,9 @@ def get_subnet_routing_table(id:) ## # @!method replace_subnet_routing_table(id:, routing_table_identity:) - # Attach a routing table to a subnet. - # This request attaches the routing table, specified in the request body, to the - # subnet specified by the subnet identifier in the URL. This replaces the existing - # routing table on the subnet. + # Replace the routing table for a subnet. + # 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 @@ -1938,13 +1949,17 @@ def list_subnet_reserved_ips(subnet_id:, start: nil, limit: nil, sort: nil) # either # `target` is deleted, or the reserved IP is unbound. Must be `false` if the # reserved IP is unbound. - # @param name [String] The user-defined name for this reserved IP. If unspecified, the name will be a - # hyphenated list of randomly-selected words. Names must be unique within the subnet - # the reserved IP resides in. Names beginning with `ibm-` are reserved for - # provider-owned resources. - # @param target [ReservedIPTargetPrototype] The target this reserved IP is to be bound to. The target must be an endpoint - # gateway not - # already bound to a reserved IP in the subnet's zone. + # @param name [String] The name for this reserved IP. The name must not be used by another reserved IP in + # the subnet. Names starting with `ibm-` are reserved for provider-owned resources, + # and are not allowed. If unspecified, the name will be a hyphenated list of + # randomly-selected words. + # @param target [ReservedIPTargetPrototype] The target to bind this reserved IP to. The target must be in the same VPC. + # + # At present, only endpoint gateway targets are supported. The endpoint gateway + # must + # not be already bound to a reserved IP in the subnet's zone. + # + # If unspecified, the reserved IP will be created unbound. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def create_subnet_reserved_ip(subnet_id:, address: nil, auto_delete: nil, name: nil, target: nil) raise ArgumentError.new("version must be provided") if version.nil? @@ -1987,6 +2002,10 @@ def create_subnet_reserved_ip(subnet_id:, address: nil, auto_delete: nil, name: # @!method delete_subnet_reserved_ip(subnet_id:, id:) # Delete a reserved IP. # This request releases a reserved IP. This operation cannot be reversed. + # + # For this request to succeed, the reserved IP must not be required by another + # resource, such as a network interface for which it is the primary IP. A + # provider-owned reserved IP is not allowed to be deleted. # @param subnet_id [String] The subnet identifier. # @param id [String] The reserved IP identifier. # @return [nil] @@ -2010,8 +2029,7 @@ def delete_subnet_reserved_ip(subnet_id:, id:) } method_url = "/subnets/%s/reserved_ips/%s" % [ERB::Util.url_encode(subnet_id), ERB::Util.url_encode(id)] - puts params - puts method_url + request( method: "DELETE", url: method_url, @@ -2067,6 +2085,8 @@ def get_subnet_reserved_ip(subnet_id:, id:) # This request updates a reserved IP with the information in a provided reserved IP # patch. The reserved IP patch object is structured in the same way as a retrieved # reserved IP and contains only the information to be updated. + # + # A provider-owned reserved IP is not allowed to be updated. # @param subnet_id [String] The subnet identifier. # @param id [String] The reserved IP identifier. # @param reserved_ip_patch [Hash] The reserved IP patch. @@ -2116,7 +2136,7 @@ def update_subnet_reserved_ip(subnet_id:, id:, reserved_ip_patch:) # List all images. # This request lists all images available in the region. An image provides source # data for a volume. Images are either system-provided, or created from another - # source, such as importing from object storage. + # source, such as importing from Cloud Object Storage. # # The images will be sorted by their `created_at` property values, with the newest # first. Images with identical `created_at` values will be secondarily sorted by @@ -2209,9 +2229,10 @@ def create_image(image_prototype:) # This request deletes an image. This operation cannot be reversed. A # system-provided image is not allowed to be deleted. Additionally, an image cannot # be deleted if it: - # - has a `status` of `tentative` or `deleting` + # - has a `status` of `deleting` # - has a `status` of `pending` with a `status_reasons` code of - # `image_request_in_progress`. + # `image_request_in_progress` + # - has `catalog_offering.managed` set to `true`. # @param id [String] The image identifier. # @return [nil] def delete_image(id:) @@ -2445,8 +2466,8 @@ def list_keys(start: nil, limit: nil) # space-separated fields: the algorithm name, base64-encoded key, and a comment). # The algorithm and comment fields may be omitted, as only the key field is # imported. - # @param name [String] The unique user-defined name for this key. If unspecified, the name will be a - # hyphenated list of randomly-selected words. + # @param name [String] The name for this key. The name must not be used by another key in the region. If + # unspecified, the name will be a hyphenated list of randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @param type [String] The crypto-system used by this key. @@ -2606,9 +2627,10 @@ def update_key(id:, key_patch:) ## # @!method list_instance_profiles # List all instance profiles. - # This request lists provisionable instance profiles in the region. An instance - # profile specifies the performance characteristics and pricing model for an - # instance. + # This request lists provisionable [instance + # profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the region. An + # instance profile specifies the performance characteristics and pricing model for + # an instance. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def list_instance_profiles raise ArgumentError.new("version must be provided") if version.nil? @@ -3394,8 +3416,8 @@ def list_instance_network_interfaces(instance_id:) # @param allow_ip_spoofing [Boolean] Indicates whether source IP spoofing is allowed on this interface. If false, # source IP spoofing is prevented on this interface. If true, source IP spoofing is # allowed on this interface. - # @param name [String] The user-defined name for network interface. Names must be unique within the - # instance the network interface resides in. If unspecified, the name will be a + # @param name [String] The name for network interface. The name must not be used by another network + # interface on the virtual server instance. If unspecified, the name will be a # hyphenated list of randomly-selected words. # @param primary_ip [NetworkInterfaceIPPrototype] The primary IP address to bind to the network interface. This can be specified # using @@ -3876,10 +3898,10 @@ def list_instance_volume_attachments(instance_id:) # @param instance_id [String] The instance identifier. # @param volume [VolumeAttachmentPrototypeVolume] An existing volume to attach to the instance, or a prototype object for a new # volume. - # @param delete_volume_on_instance_delete [Boolean] If set to true, when deleting the instance the volume will also be deleted. - # @param name [String] The user-defined name for this volume attachment. Names must be unique within the - # instance the volume attachment resides in. If unspecified, the name will be a - # hyphenated list of randomly-selected words. + # @param delete_volume_on_instance_delete [Boolean] Indicates whether deleting the instance will also delete the attached volume. + # @param name [String] The name for this volume attachment. The name must not be used by another volume + # attachment on the instance. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def create_instance_volume_attachment(instance_id:, volume:, delete_volume_on_instance_delete: nil, name: nil) raise ArgumentError.new("version must be provided") if version.nil? @@ -4094,19 +4116,23 @@ def list_instance_groups(start: nil, limit: nil) # Instance groups are not compatible with instance templates that specify `true` for # `default_trusted_profile.auto_link`. # @param subnets [Array[SubnetIdentity]] The subnets to use when creating new instances. - # @param application_port [Fixnum] Required if specifying a load balancer pool only. Used by the instance group when - # scaling up instances to supply the port for the load balancer pool member. + # @param application_port [Fixnum] The port to use for new load balancer pool members created by this instance group. + # + # This property must be specified if and only if `load_balancer_pool` has been + # specified. # @param load_balancer [LoadBalancerIdentity] The load balancer associated with the specified load balancer pool. # Required if `load_balancer_pool` is specified. # # At present, only load balancers in the `application` family are supported. - # @param load_balancer_pool [LoadBalancerPoolIdentity] If specified, the load balancer pool will be managed by this - # group. Instances created by this group will have a new load - # balancer pool member in that pool created. Must be used with - # `application_port`. + # @param load_balancer_pool [LoadBalancerPoolIdentity] If specified, the load balancer pool this instance group will manage. A pool + # member + # will be created for each instance created by this group. + # + # If specified, `load_balancer` and `application_port` must also be specified. # @param membership_count [Fixnum] The number of instances in the instance group. - # @param name [String] The unique user-defined name for this instance group. If unspecified, the name - # will be a hyphenated list of randomly-selected words. + # @param name [String] The name for this instance group. The name must not be used by another instance + # group in the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -5203,8 +5229,9 @@ def list_dedicated_host_groups(start: nil, limit: nil, resource_group_id: nil, z # @param _class [String] The dedicated host profile class for hosts in this group. # @param family [String] The dedicated host profile family for hosts in this group. # @param zone [ZoneIdentity] The zone this dedicated host group will reside in. - # @param name [String] The unique user-defined name for this dedicated host group. If unspecified, the - # name will be a hyphenated list of randomly-selected words. + # @param name [String] The name for this dedicated host group. The name must not be used by another + # dedicated host group in the region. If unspecified, the name will be a hyphenated + # list of randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -5363,7 +5390,8 @@ def update_dedicated_host_group(id:, dedicated_host_group_patch:) ## # @!method list_dedicated_host_profiles(start: nil, limit: nil) # List all dedicated host profiles. - # This request lists all provisionable dedicated host profiles in the region. A + # This request lists provisionable [dedicated host + # profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in the region. A # dedicated host profile specifies the hardware characteristics for a dedicated # host. # @param start [String] A server-provided token determining what resource to start the page on. @@ -5814,9 +5842,9 @@ def list_backup_policies(start: nil, limit: nil, resource_group_id: nil, name: n # user tag and a matching type will be subject to the backup policy. # @param match_resource_types [Array[String]] A resource type this backup policy applies to. Resources that have both a matching # type and a matching user tag will be subject to the backup policy. - # @param name [String] The user-defined name for this backup policy. Names must be unique within the - # region this backup policy resides in. If unspecified, the name will be a - # hyphenated list of randomly-selected words. + # @param name [String] The name for this backup policy. The name must not be used by another backup + # policy in the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param plans [Array[BackupPolicyPlanPrototype]] The prototype objects for backup plans to be created for this backup policy. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -5857,6 +5885,105 @@ def create_backup_policy(match_user_tags: nil, match_resource_types: nil, name: response end + ## + # @!method list_backup_policy_jobs(backup_policy_id:, status: nil, backup_policy_plan_id: nil, start: nil, limit: nil, sort: nil, source_id: nil, target_snapshots_id: nil, target_snapshots_crn: nil) + # List all jobs for a backup policy. + # This request retrieves all jobs for a backup policy. A backup job represents the + # execution of a backup policy plan for a resource matching the policy's criteria. + # @param backup_policy_id [String] The backup policy identifier. + # @param status [String] Filters the collection to backup policy jobs with the specified status. + # @param backup_policy_plan_id [String] Filters the collection to backup policy jobs with the backup plan with the + # specified identifier. + # @param start [String] A server-provided token determining what resource to start the page on. + # @param limit [Fixnum] The number of resources to return on a page. + # @param sort [String] Sorts the returned collection by the specified property name in ascending order. A + # `-` may be prepended to the name to sort in descending order. For example, the + # value `-created_at` sorts the collection by the `created_at` property in + # descending order, and the value `name` sorts it by the `name` property in + # ascending order. + # @param source_id [String] Filters the collection to backup policy jobs with a source with the specified + # identifier. + # @param target_snapshots_id [String] Filters the collection to resources with the target snapshot with the specified + # identifier. + # @param target_snapshots_crn [String] Filters the collection to backup policy jobs with the target snapshot with the + # specified CRN. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def list_backup_policy_jobs(backup_policy_id:, status: nil, backup_policy_plan_id: nil, start: nil, limit: nil, sort: nil, source_id: nil, target_snapshots_id: nil, target_snapshots_crn: nil) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("backup_policy_id must be provided") if backup_policy_id.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "list_backup_policy_jobs") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation, + "status" => status, + "backup_policy_plan.id" => backup_policy_plan_id, + "start" => start, + "limit" => limit, + "sort" => sort, + "source.id" => source_id, + "target_snapshots[].id" => target_snapshots_id, + "target_snapshots[].crn" => target_snapshots_crn + } + + method_url = "/backup_policies/%s/jobs" % [ERB::Util.url_encode(backup_policy_id)] + + response = request( + method: "GET", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end + + ## + # @!method get_backup_policy_job(backup_policy_id:, id:) + # Retrieve a backup policy job. + # This request retrieves a single backup policy job specified by the identifier in + # the URL. + # @param backup_policy_id [String] The backup policy identifier. + # @param id [String] The backup policy job identifier. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def get_backup_policy_job(backup_policy_id:, id:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("backup_policy_id must be provided") if backup_policy_id.nil? + + raise ArgumentError.new("id must be provided") if id.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "get_backup_policy_job") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/backup_policies/%s/jobs/%s" % [ERB::Util.url_encode(backup_policy_id), ERB::Util.url_encode(id)] + + response = request( + method: "GET", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end + ## # @!method list_backup_policy_plans(backup_policy_id:, name: nil) # List all plans for a backup policy. @@ -5896,7 +6023,7 @@ def list_backup_policy_plans(backup_policy_id:, name: nil) end ## - # @!method create_backup_policy_plan(backup_policy_id:, cron_spec:, active: nil, attach_user_tags: nil, copy_user_tags: nil, deletion_trigger: nil, name: nil) + # @!method create_backup_policy_plan(backup_policy_id:, cron_spec:, active: nil, attach_user_tags: nil, clone_policy: nil, copy_user_tags: nil, deletion_trigger: nil, name: nil) # Create a plan for a backup policy. # This request creates a new backup policy plan from a backup policy plan prototype # object. The prototype object is structured in the same way as a retrieved backup @@ -5917,14 +6044,15 @@ def list_backup_policy_plans(backup_policy_id:, name: nil) # @param active [Boolean] Indicates whether the plan is active. # @param attach_user_tags [Array[String]] User tags to attach to each backup (snapshot) created by this plan. If # unspecified, no user tags will be attached. + # @param clone_policy [BackupPolicyPlanClonePolicyPrototype] # @param copy_user_tags [Boolean] Indicates whether to copy the source's user tags to the created backups # (snapshots). # @param deletion_trigger [BackupPolicyPlanDeletionTriggerPrototype] - # @param name [String] The user-defined name for this backup policy plan. Names must be unique within the - # backup policy this plan resides in. If unspecified, the name will be a hyphenated - # list of randomly-selected words. + # @param name [String] The name for this backup policy plan. The name must not be used by another plan + # for the backup policy. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def create_backup_policy_plan(backup_policy_id:, cron_spec:, active: nil, attach_user_tags: nil, copy_user_tags: nil, deletion_trigger: nil, name: nil) + def create_backup_policy_plan(backup_policy_id:, cron_spec:, active: nil, attach_user_tags: nil, clone_policy: nil, copy_user_tags: nil, deletion_trigger: nil, name: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -5947,6 +6075,7 @@ def create_backup_policy_plan(backup_policy_id:, cron_spec:, active: nil, attach "cron_spec" => cron_spec, "active" => active, "attach_user_tags" => attach_user_tags, + "clone_policy" => clone_policy, "copy_user_tags" => copy_user_tags, "deletion_trigger" => deletion_trigger, "name" => name @@ -6278,8 +6407,9 @@ def list_placement_groups(start: nil, limit: nil) # this property, check for and log unknown values. Optionally halt processing and # surface the error, or bypass the placement group on which the unexpected strategy # was encountered. - # @param name [String] The unique user-defined name for this placement group. If unspecified, the name - # will be a hyphenated list of randomly-selected words. + # @param name [String] The name for this placement group. The name must not be used by another placement + # group in the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -6442,9 +6572,10 @@ def update_placement_group(id:, placement_group_patch:) ## # @!method list_bare_metal_server_profiles(start: nil, limit: nil) # List all bare metal server profiles. - # This request lists all bare metal server profiles available in the region. A bare - # metal server profile specifies the performance characteristics and pricing model - # for a bare metal server. + # This request lists all [bare metal server + # profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + # available in the region. A bare metal server profile specifies the performance + # characteristics and pricing model for a bare metal server. # @param start [String] A server-provided token determining what resource to start the page on. # @param limit [Fixnum] The number of resources to return on a page. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -6569,7 +6700,7 @@ def list_bare_metal_servers(start: nil, limit: nil, resource_group_id: nil, name end ## - # @!method create_bare_metal_server(initialization:, primary_network_interface:, profile:, zone:, name: nil, network_interfaces: nil, resource_group: nil, vpc: nil) + # @!method create_bare_metal_server(initialization:, primary_network_interface:, profile:, zone:, enable_secure_boot: nil, name: nil, network_interfaces: nil, resource_group: nil, trusted_platform_module: nil, vpc: nil) # Create a bare metal server. # This request provisions a new bare metal server from a prototype object. The # prototype object is structured in the same way as a retrieved bare metal server, @@ -6577,18 +6708,26 @@ def list_bare_metal_servers(start: nil, limit: nil, resource_group_id: nil, name # bare metal server is automatically started. # @param initialization [BareMetalServerInitializationPrototype] # @param primary_network_interface [BareMetalServerPrimaryNetworkInterfacePrototype] Primary network interface for the bare metal server. - # @param profile [BareMetalServerProfileIdentity] The profile to use for this bare metal server. + # @param profile [BareMetalServerProfileIdentity] The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + # to use for this bare metal server. # @param zone [ZoneIdentity] The zone this bare metal server will reside in. - # @param name [String] The unique user-defined name for this bare metal server (and default system - # hostname). If unspecified, the name will be a hyphenated list of randomly-selected - # words. + # @param enable_secure_boot [Boolean] Indicates whether secure boot is enabled. If enabled, the image must support + # secure boot or the server will fail to boot. + # @param name [String] The name for this bare metal server. The name must not be used by another bare + # metal server in the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. + # + # The system hostname will be based on this name. # @param network_interfaces [Array[BareMetalServerNetworkInterfacePrototype]] The additional network interfaces to create for the bare metal server. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - # @param vpc [VPCIdentity] The VPC the bare metal server is to be a part of. If specified, it must match the - # VPC referenced by the subnets of the server's network interfaces. + # @param trusted_platform_module [BareMetalServerTrustedPlatformModulePrototype] + # @param vpc [VPCIdentity] The VPC this bare metal server will reside in. + # + # If specified, it must match the VPC for the subnets of the server's network + # interfaces. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def create_bare_metal_server(initialization:, primary_network_interface:, profile:, zone:, name: nil, network_interfaces: nil, resource_group: nil, vpc: nil) + def create_bare_metal_server(initialization:, primary_network_interface:, profile:, zone:, enable_secure_boot: nil, name: nil, network_interfaces: nil, resource_group: nil, trusted_platform_module: nil, vpc: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -6616,9 +6755,11 @@ def create_bare_metal_server(initialization:, primary_network_interface:, profil "primary_network_interface" => primary_network_interface, "profile" => profile, "zone" => zone, + "enable_secure_boot" => enable_secure_boot, "name" => name, "network_interfaces" => network_interfaces, "resource_group" => resource_group, + "trusted_platform_module" => trusted_platform_module, "vpc" => vpc } @@ -6644,7 +6785,9 @@ def create_bare_metal_server(initialization:, primary_network_interface:, profil # request. The access token is only valid for a short period of time, and a maximum # of one token is valid for a given bare metal server at a time. # @param bare_metal_server_id [String] The bare metal server identifier. - # @param console_type [String] The bare metal server console type for which this token may be used. + # @param console_type [String] The bare metal server console type for which this token may be used + # + # Must be `serial` for bare metal servers with a `cpu.architecture` of `s390x`. # @param force [Boolean] Indicates whether to disconnect an existing serial console session as the serial # console cannot be shared. This has no effect on VNC consoles. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -7191,6 +7334,86 @@ def add_bare_metal_server_network_interface_floating_ip(bare_metal_server_id:, n response end + ## + # @!method list_bare_metal_server_network_interface_ips(bare_metal_server_id:, network_interface_id:) + # List all reserved IPs bound to a network interface. + # This request lists all reserved IPs bound to a network interface. + # @param bare_metal_server_id [String] The bare metal server identifier. + # @param network_interface_id [String] The network interface identifier. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def list_bare_metal_server_network_interface_ips(bare_metal_server_id:, network_interface_id:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("bare_metal_server_id must be provided") if bare_metal_server_id.nil? + + raise ArgumentError.new("network_interface_id must be provided") if network_interface_id.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "list_bare_metal_server_network_interface_ips") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/bare_metal_servers/%s/network_interfaces/%s/ips" % [ERB::Util.url_encode(bare_metal_server_id), ERB::Util.url_encode(network_interface_id)] + + response = request( + method: "GET", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end + + ## + # @!method get_bare_metal_server_network_interface_ip(bare_metal_server_id:, network_interface_id:, id:) + # Retrieve bound reserved IP. + # This request a retrieves the specified reserved IP address if it is bound to the + # network interface and bare metal server specified in the URL. + # @param bare_metal_server_id [String] The bare metal server identifier. + # @param network_interface_id [String] The network interface identifier. + # @param id [String] The reserved IP identifier. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def get_bare_metal_server_network_interface_ip(bare_metal_server_id:, network_interface_id:, id:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("bare_metal_server_id must be provided") if bare_metal_server_id.nil? + + raise ArgumentError.new("network_interface_id must be provided") if network_interface_id.nil? + + raise ArgumentError.new("id must be provided") if id.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "get_bare_metal_server_network_interface_ip") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/bare_metal_servers/%s/network_interfaces/%s/ips/%s" % [ERB::Util.url_encode(bare_metal_server_id), ERB::Util.url_encode(network_interface_id), ERB::Util.url_encode(id)] + + response = request( + method: "GET", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end + ## # @!method delete_bare_metal_server(id:) # Delete a bare metal server. @@ -7471,8 +7694,10 @@ def stop_bare_metal_server(id:, type:) ## # @!method list_volume_profiles(start: nil, limit: nil) # List all volume profiles. - # This request lists all volume profiles available in the region. A volume profile - # specifies the performance characteristics and pricing model for a volume. + # This request lists all [volume + # profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + # available in the region. A volume profile specifies the performance + # characteristics and pricing model for a volume. # @param start [String] A server-provided token determining what resource to start the page on. # @param limit [Fixnum] The number of resources to return on a page. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -7784,7 +8009,7 @@ def delete_snapshots(source_volume_id:) end ## - # @!method list_snapshots(start: nil, limit: nil, tag: nil, resource_group_id: nil, name: nil, source_volume_id: nil, source_volume_crn: nil, source_image_id: nil, source_image_crn: nil, sort: nil, backup_policy_plan_id: nil) + # @!method list_snapshots(start: nil, limit: nil, tag: nil, resource_group_id: nil, name: nil, source_volume_id: nil, source_volume_crn: nil, source_image_id: nil, source_image_crn: nil, sort: nil, backup_policy_plan_id: nil, clones_zone_name: nil) # List all snapshots. # This request lists all snapshots in the region. A snapshot preserves the data of a # volume at the time the snapshot is created. @@ -7815,8 +8040,9 @@ def delete_snapshots(source_volume_id:) # ascending order. # @param backup_policy_plan_id [String] Filters the collection to backup policy jobs with the backup plan with the # specified identifier. + # @param clones_zone_name [String] Filters the collection to resources with a clone in the specified zone. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def list_snapshots(start: nil, limit: nil, tag: nil, resource_group_id: nil, name: nil, source_volume_id: nil, source_volume_crn: nil, source_image_id: nil, source_image_crn: nil, sort: nil, backup_policy_plan_id: nil) + def list_snapshots(start: nil, limit: nil, tag: nil, resource_group_id: nil, name: nil, source_volume_id: nil, source_volume_crn: nil, source_image_id: nil, source_image_crn: nil, sort: nil, backup_policy_plan_id: nil, clones_zone_name: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -7839,7 +8065,8 @@ def list_snapshots(start: nil, limit: nil, tag: nil, resource_group_id: nil, nam "source_image.id" => source_image_id, "source_image.crn" => source_image_crn, "sort" => sort, - "backup_policy_plan.id" => backup_policy_plan_id + "backup_policy_plan.id" => backup_policy_plan_id, + "clones[].zone.name" => clones_zone_name } method_url = "/snapshots" @@ -8012,6 +8239,160 @@ def update_snapshot(id:, snapshot_patch:, if_match: nil) ) response end + + ## + # @!method list_snapshot_clones(id:) + # List all clones for a snapshot. + # This request lists all clones for a snapshot. Use a clone to quickly restore a + # snapshot within the clone's zone. + # @param id [String] The snapshot identifier. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def list_snapshot_clones(id:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("id must be provided") if id.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "list_snapshot_clones") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/snapshots/%s/clones" % [ERB::Util.url_encode(id)] + + response = request( + method: "GET", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end + + ## + # @!method delete_snapshot_clone(id:, zone_name:) + # Delete a snapshot clone. + # This request deletes a snapshot clone. This operation cannot be reversed, but an + # equivalent clone may be recreated from the snapshot. + # @param id [String] The snapshot identifier. + # @param zone_name [String] The zone name. + # @return [nil] + def delete_snapshot_clone(id:, zone_name:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("id must be provided") if id.nil? + + raise ArgumentError.new("zone_name must be provided") if zone_name.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "delete_snapshot_clone") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/snapshots/%s/clones/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(zone_name)] + + request( + method: "DELETE", + url: method_url, + headers: headers, + params: params, + accept_json: false + ) + nil + end + + ## + # @!method get_snapshot_clone(id:, zone_name:) + # Retrieve a snapshot clone. + # This request retrieves a single clone specified by the snapshot identifier and + # zone name in the URL. + # @param id [String] The snapshot identifier. + # @param zone_name [String] The zone name. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def get_snapshot_clone(id:, zone_name:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("id must be provided") if id.nil? + + raise ArgumentError.new("zone_name must be provided") if zone_name.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "get_snapshot_clone") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/snapshots/%s/clones/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(zone_name)] + + response = request( + method: "GET", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end + + ## + # @!method create_snapshot_clone(id:, zone_name:) + # Create a clone for a snapshot. + # This request creates a new clone for a snapshot in the specified zone. A request + # body is not required, and if provided, is ignored. If the snapshot already has a + # clone in the zone, it is returned. + # @param id [String] The snapshot identifier. + # @param zone_name [String] The zone name. + # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. + def create_snapshot_clone(id:, zone_name:) + raise ArgumentError.new("version must be provided") if version.nil? + + raise ArgumentError.new("generation must be provided") if generation.nil? + + raise ArgumentError.new("id must be provided") if id.nil? + + raise ArgumentError.new("zone_name must be provided") if zone_name.nil? + + headers = { + } + sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "create_snapshot_clone") + headers.merge!(sdk_headers) + + params = { + "version" => @version, + "generation" => @generation + } + + method_url = "/snapshots/%s/clones/%s" % [ERB::Util.url_encode(id), ERB::Util.url_encode(zone_name)] + + response = request( + method: "PUT", + url: method_url, + headers: headers, + params: params, + accept_json: true + ) + response + end ######################### # Geography ######################### @@ -8220,12 +8601,12 @@ def list_public_gateways(start: nil, limit: nil, resource_group_id: nil) # provided, one will be created and bound to the public gateway. Once a public # gateway has been created, its floating IP cannot be unbound. A public gateway must # be explicitly attached to each subnet it will provide connectivity for. - # @param vpc [VPCIdentity] The VPC this public gateway will serve. + # @param vpc [VPCIdentity] The VPC this public gateway will reside in. # @param zone [ZoneIdentity] The zone this public gateway will reside in. # @param floating_ip [PublicGatewayFloatingIPPrototype] - # @param name [String] The user-defined name for this public gateway. Names must be unique within the VPC - # the public gateway resides in. If unspecified, the name will be a hyphenated list - # of randomly-selected words. + # @param name [String] The name for this public gateway. The name must not be used by another public + # gateway in the VPC. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -8636,9 +9017,9 @@ def list_network_acls(start: nil, limit: nil, resource_group_id: nil) ## # @!method create_network_acl(network_acl_prototype: nil) # Create a network ACL. - # This request creates a new network ACL from a network ACL prototype object. The - # prototype object is structured in the same way as a retrieved network ACL, and - # contains the information necessary to create the new network ACL. + # This request creates a new stateless network ACL from a network ACL prototype + # object. The prototype object is structured in the same way as a retrieved network + # ACL, and contains the information necessary to create the new network ACL. # @param network_acl_prototype [NetworkACLPrototype] The network ACL prototype object. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def create_network_acl(network_acl_prototype: nil) @@ -9059,10 +9440,10 @@ def list_security_groups(start: nil, limit: nil, resource_group_id: nil, vpc_id: # security group rules are included in the prototype object, those rules will be # added to the security group. Each security group is scoped to one VPC. Only # network interfaces on instances in that VPC can be added to the security group. - # @param vpc [VPCIdentity] The VPC this security group is to be a part of. - # @param name [String] The user-defined name for this security group. If unspecified, the name will be a - # hyphenated list of randomly-selected words. Names must be unique within the VPC - # the security group resides in. + # @param vpc [VPCIdentity] The VPC this security group will reside in. + # @param name [String] The name for this security group. The name must not be used by another security + # group for the VPC. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @param rules [Array[SecurityGroupRulePrototype]] The prototype objects for rules to be created for this security group. If @@ -9482,7 +9863,8 @@ def list_security_group_targets(security_group_id:, start: nil, limit: nil) # the target must be attached to at least one other security group. The specified # target identifier can be: # - # - A network interface identifier + # - An instance network interface identifier + # - A bare metal server network interface identifier # - A VPN server identifier # - An application load balancer identifier # - An endpoint gateway identifier @@ -9568,7 +9950,8 @@ def get_security_group_target(security_group_id:, id:) # This request adds a resource to an existing security group. The specified target # identifier can be: # - # - A network interface identifier + # - An instance network interface identifier + # - A bare metal server network interface identifier # - A VPN server identifier # - An application load balancer identifier # - An endpoint gateway identifier @@ -9652,12 +10035,20 @@ def list_ike_policies(start: nil, limit: nil) # @!method create_ike_policy(authentication_algorithm:, dh_group:, encryption_algorithm:, ike_version:, key_lifetime: nil, name: nil, resource_group: nil) # Create an IKE policy. # This request creates a new IKE policy. - # @param authentication_algorithm [String] The authentication algorithm. - # @param dh_group [Fixnum] The Diffie-Hellman group. - # @param encryption_algorithm [String] The encryption algorithm. + # @param authentication_algorithm [String] The authentication algorithm + # + # The `md5` and `sha1` algorithms have been deprecated. + # @param dh_group [Fixnum] The Diffie-Hellman group + # + # Groups `2` and `5` have been deprecated. + # @param encryption_algorithm [String] The encryption algorithm + # + # The `triple_des` algorithm has been deprecated. # @param ike_version [Fixnum] The IKE protocol version. # @param key_lifetime [Fixnum] The key lifetime in seconds. - # @param name [String] The user-defined name for this IKE policy. + # @param name [String] The name for this IKE policy. The name must not be used by another IKE policies in + # the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -9896,11 +10287,26 @@ def list_ipsec_policies(start: nil, limit: nil) # @!method create_ipsec_policy(authentication_algorithm:, encryption_algorithm:, pfs:, key_lifetime: nil, name: nil, resource_group: nil) # Create an IPsec policy. # This request creates a new IPsec policy. - # @param authentication_algorithm [String] The authentication algorithm. - # @param encryption_algorithm [String] The encryption algorithm. - # @param pfs [String] Perfect Forward Secrecy. + # @param authentication_algorithm [String] The authentication algorithm + # + # The `md5` and `sha1` algorithms have been deprecated + # + # Must be `disabled` if and only if the `encryption_algorithm` is + # `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + # @param encryption_algorithm [String] The encryption algorithm + # + # The `triple_des` algorithm has been deprecated + # + # The `authentication_algorithm` must be `disabled` if and only if + # `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + # `aes256gcm16`. + # @param pfs [String] Perfect Forward Secrecy + # + # Groups `group_2` and `group_5` have been deprecated. # @param key_lifetime [Fixnum] The key lifetime in seconds. - # @param name [String] The user-defined name for this IPsec policy. + # @param name [String] The name for this IPsec policy. The name must not be used by another IPsec + # policies in the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. @@ -10098,16 +10504,21 @@ def list_ipsec_policy_connections(id:) end ## - # @!method list_vpn_gateways(start: nil, limit: nil, resource_group_id: nil, mode: nil) + # @!method list_vpn_gateways(start: nil, limit: nil, resource_group_id: nil, sort: nil, mode: nil) # List all VPN gateways. # This request lists all VPN gateways in the region. # @param start [String] A server-provided token determining what resource to start the page on. # @param limit [Fixnum] The number of resources to return on a page. # @param resource_group_id [String] Filters the collection to resources in the resource group with the specified # identifier. + # @param sort [String] Sorts the returned collection by the specified property name in ascending order. A + # `-` may be prepended to the name to sort in descending order. For example, the + # value `-created_at` sorts the collection by the `created_at` property in + # descending order, and the value `name` sorts it by the `name` property in + # ascending order. # @param mode [String] Filters the collection to VPN gateways with the specified mode. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def list_vpn_gateways(start: nil, limit: nil, resource_group_id: nil, mode: nil) + def list_vpn_gateways(start: nil, limit: nil, resource_group_id: nil, sort: nil, mode: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -10123,6 +10534,7 @@ def list_vpn_gateways(start: nil, limit: nil, resource_group_id: nil, mode: nil) "start" => start, "limit" => limit, "resource_group.id" => resource_group_id, + "sort" => sort, "mode" => mode } @@ -10935,9 +11347,9 @@ def list_vpn_servers(name: nil, start: nil, limit: nil, resource_group_id: nil, # @param client_idle_timeout [Fixnum] The seconds a VPN client can be idle before this VPN server will disconnect it. # Specify `0` to prevent the server from disconnecting idle clients. # @param enable_split_tunneling [Boolean] Indicates whether the split tunneling is enabled on this VPN server. - # @param name [String] The user-defined name for this VPN server. If unspecified, the name will be a - # hyphenated list of randomly-selected words. Names must be unique within the VPC - # this VPN server is serving. + # @param name [String] The name for this VPN server. The name must not be used by another VPN server in + # the VPC. If unspecified, the name will be a hyphenated list of randomly-selected + # words. # @param port [Fixnum] The port number to use for this VPN server. # @param protocol [String] The transport protocol to use for this VPN server. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource @@ -11387,9 +11799,9 @@ def list_vpn_server_routes(vpn_server_id:, start: nil, limit: nil, sort: nil) # processing this property, check for and log unknown values. Optionally halt # processing and surface the error, or bypass the VPN route on which the unexpected # property value was encountered. - # @param name [String] The user-defined name for this VPN route. If unspecified, the name will be a - # hyphenated list of randomly-selected words. Names must be unique within the VPN - # server the VPN route resides in. + # @param name [String] The name for this VPN server route. The name must not be used by another route for + # the VPN server. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. def create_vpn_server_route(vpn_server_id:, destination:, action: nil, name: nil) raise ArgumentError.new("version must be provided") if version.nil? @@ -11665,27 +12077,30 @@ def list_load_balancers(start: nil, limit: nil) end ## - # @!method create_load_balancer(is_public:, subnets:, listeners: nil, logging: nil, name: nil, pools: nil, profile: nil, resource_group: nil, route_mode: nil, security_groups: nil) + # @!method create_load_balancer(is_public:, subnets:, datapath: nil, listeners: nil, logging: nil, name: nil, pools: nil, profile: nil, resource_group: nil, route_mode: nil, security_groups: nil) # Create a load balancer. # This request creates and provisions a new load balancer. - # @param is_public [Boolean] Indicates whether this load balancer is public or private. + # @param is_public [Boolean] Indicates whether this load balancer is public. # - # At present, if route mode is enabled, the load balancer must be private. - # @param subnets [Array[SubnetIdentity]] The subnets to provision this load balancer in. The load balancer's availability - # will depend on the availability of the zones the specified subnets reside in. + # At present, if route mode is enabled, the load balancer must not be public. + # @param subnets [Array[SubnetIdentity]] The subnets to provision this load balancer in. The subnets must be in the same + # VPC. The load balancer's availability will depend on the availability of the zones + # that the subnets reside in. # # Load balancers in the `network` family allow only one subnet to be specified. + # @param datapath [LoadBalancerLoggingDatapathPrototype] The datapath logging configuration for this load balancer. # @param listeners [Array[LoadBalancerListenerPrototypeLoadBalancerContext]] The listeners of this load balancer. - # @param logging [LoadBalancerLogging] The logging configuration to use for this load balancer. See [VPC Datapath - # Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) - # on the logging format, fields and permitted values. + # @param logging [LoadBalancerLoggingPrototype] The logging configuration to use for this load balancer. See [VPC Datapath + # Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the logging + # format, fields and permitted values. # # To activate logging, the load balancer profile must support the specified logging # type. - # @param name [String] The user-defined name for this load balancer. If unspecified, the name will be a - # hyphenated list of randomly-selected words. + # @param name [String] The name for this load balancer. The name must not be used by another load + # balancer in the VPC. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param pools [Array[LoadBalancerPoolPrototype]] The pools of this load balancer. - # @param profile [LoadBalancerProfileIdentity] The profile to use for this load balancer + # @param profile [LoadBalancerProfileIdentity] The profile to use for this load balancer. # # If unspecified, `application` will be used. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource @@ -11698,7 +12113,7 @@ def list_load_balancers(start: nil, limit: nil) # # The load balancer profile must support security groups. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def create_load_balancer(is_public:, subnets:, listeners: nil, logging: nil, name: nil, pools: nil, profile: nil, resource_group: nil, route_mode: nil, security_groups: nil) + def create_load_balancer(is_public:, subnets:, datapath: nil, listeners: nil, logging: nil, name: nil, pools: nil, profile: nil, resource_group: nil, route_mode: nil, security_groups: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -11720,6 +12135,7 @@ def create_load_balancer(is_public:, subnets:, listeners: nil, logging: nil, nam data = { "is_public" => is_public, "subnets" => subnets, + "datapath" => datapath, "listeners" => listeners, "logging" => logging, "name" => name, @@ -11744,13 +12160,15 @@ def create_load_balancer(is_public:, subnets:, listeners: nil, logging: nil, nam end ## - # @!method delete_load_balancer(id:) + # @!method delete_load_balancer(id:, if_match: nil) # Delete a load balancer. # This request deletes a load balancer. This operation cannot be reversed. A load # balancer cannot be deleted if its `provisioning_status` is `delete_pending`. # @param id [String] The load balancer identifier. + # @param if_match [String] If present, the request will fail if the specified ETag value does not match the + # resource's current ETag value. # @return [nil] - def delete_load_balancer(id:) + def delete_load_balancer(id:, if_match: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -11758,6 +12176,7 @@ def delete_load_balancer(id:) raise ArgumentError.new("id must be provided") if id.nil? headers = { + "If-Match" => if_match } sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "delete_load_balancer") headers.merge!(sdk_headers) @@ -11816,13 +12235,18 @@ def get_load_balancer(id:) end ## - # @!method update_load_balancer(id:, load_balancer_patch:) + # @!method update_load_balancer(id:, load_balancer_patch:, if_match: nil) # Update a load balancer. - # This request updates a load balancer. + # This request updates a load balancer with the information in a provided load + # balancer patch. The load balancer patch object is structured in the same way as a + # retrieved load balancer and contains only the information to be updated. A load + # balancer can only be updated if its `provisioning_status` is `active`. # @param id [String] The load balancer identifier. # @param load_balancer_patch [Hash] The load balancer patch. + # @param if_match [String] 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. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. - def update_load_balancer(id:, load_balancer_patch:) + def update_load_balancer(id:, load_balancer_patch:, if_match: nil) raise ArgumentError.new("version must be provided") if version.nil? raise ArgumentError.new("generation must be provided") if generation.nil? @@ -11832,6 +12256,7 @@ def update_load_balancer(id:, load_balancer_patch:) raise ArgumentError.new("load_balancer_patch must be provided") if load_balancer_patch.nil? headers = { + "If-Match" => if_match } sdk_headers = Common.new.get_sdk_headers("vpc", "V1", "update_load_balancer") headers.merge!(sdk_headers) @@ -11933,10 +12358,16 @@ def list_load_balancer_listeners(load_balancer_id:) # This request creates a new listener for a load balancer. # @param load_balancer_id [String] The load balancer identifier. # @param protocol [String] The listener protocol. Each listener in the load balancer must have a unique - # `port` and `protocol` combination. Additional restrictions: - # - If this load balancer is in the `network` family: - # - The protocol must be `tcp` or `udp` (if `udp_supported` is `true`). - # - If `default_pool` is set, the pool protocol must match. + # `port` and `protocol` combination. + # + # Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` + # is `true`). Load balancers in the `application` family support `tcp`, `http` and + # `https`. + # + # Additional restrictions: + # - If `default_pool` is set, the pool's protocol must match, or be compatible with + # the listener's protocol. At present, the compatible protocols are `http` and + # `https`. # - If `https_redirect` is set, the protocol must be `http`. # @param accept_proxy_protocol [Boolean] If set to `true`, this listener will accept and forward PROXY protocol # information. Supported by load balancers in the `application` family (otherwise @@ -11947,19 +12378,21 @@ def list_load_balancer_listeners(load_balancer_id:) # - If this listener is the target of another listener's `https_redirect`, its # `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` # value. - # @param certificate_instance [CertificateInstanceIdentity] The certificate instance used for SSL termination. It is applicable only to - # `https` - # protocol. + # @param certificate_instance [CertificateInstanceIdentity] The certificate instance to use for SSL termination. The listener must have a + # `protocol` of `https`. # @param connection_limit [Fixnum] The connection limit of the listener. - # @param default_pool [LoadBalancerPoolIdentity] The default pool for this listener. The specified pool must: - # - # - Belong to this load balancer + # @param default_pool [LoadBalancerPoolIdentity] The default pool for this listener. If specified, the pool must: + # - Belong to this load balancer. # - Have the same `protocol` as this listener, or have a compatible protocol. # At present, the compatible protocols are `http` and `https`. # - Not already be the `default_pool` for another listener. + # + # If unspecified, this listener will be created with no default pool, but one may be + # subsequently set. # @param https_redirect [LoadBalancerListenerHTTPSRedirectPrototype] The target listener that requests will be redirected to. This listener must have a # `protocol` of `http`, and the target listener must have a `protocol` of `https`. - # @param policies [Array[LoadBalancerListenerPolicyPrototype]] The policy prototype objects for this listener. + # @param policies [Array[LoadBalancerListenerPolicyPrototype]] The policy prototype objects for this listener. The load balancer must be in the + # `application` family. # @param port [Fixnum] The listener port number, or the inclusive lower bound of the port range. Each # listener in the load balancer must have a unique `port` and `protocol` # combination. @@ -12204,8 +12637,9 @@ def list_load_balancer_listener_policies(load_balancer_id:, listener_id:) # processing and surface the error, or bypass the policy on which the unexpected # property value was encountered. # @param priority [Fixnum] Priority of the policy. Lower value indicates higher priority. - # @param name [String] The user-defined name for this policy. Names must be unique within the load - # balancer listener the policy resides in. + # @param name [String] The name for this policy. The name must not be used by another policy for the load + # balancer listener. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param rules [Array[LoadBalancerListenerPolicyRulePrototype]] The rule prototype objects for this policy. # @param target [LoadBalancerListenerPolicyTargetPrototype] - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. # - If `action` is `redirect`, specify a @@ -12690,8 +13124,9 @@ def list_load_balancer_pools(load_balancer_id:) # @param members [Array[LoadBalancerPoolMemberPrototype]] The members for this load balancer pool. For load balancers in the `network` # family, the same `port` and `target` tuple cannot be shared by a pool member of # any other load balancer in the same VPC. - # @param name [String] The user-defined name for this load balancer pool. If unspecified, the name will - # be a hyphenated list of randomly-selected words. + # @param name [String] The name for this load balancer pool. The name must not be used by another pool + # for the load balancer. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param proxy_protocol [String] The PROXY protocol setting for this pool: # - `v1`: Enabled with version 1 (human-readable header format) # - `v2`: Enabled with version 2 (binary header format) @@ -13203,13 +13638,15 @@ def list_endpoint_gateways(name: nil, start: nil, limit: nil, resource_group_id: # Create an endpoint gateway. # This request creates a new endpoint gateway. An endpoint gateway maps one or more # reserved IPs in a VPC to a target outside the VPC. - # @param target [EndpointGatewayTargetPrototype] The target for this endpoint gateway. - # @param vpc [VPCIdentity] The VPC this endpoint gateway will serve. + # @param target [EndpointGatewayTargetPrototype] The target to use for this endpoint gateway. Must not already be the target of + # another + # endpoint gateway in the VPC. + # @param vpc [VPCIdentity] The VPC this endpoint gateway will reside in. # @param ips [Array[EndpointGatewayReservedIP]] The reserved IPs to bind to this endpoint gateway. At most one reserved IP per # zone is allowed. - # @param name [String] The user-defined name for this endpoint gateway. If unspecified, the name will be - # a hyphenated list of randomly-selected words. Names must be unique within the VPC - # this endpoint gateway is serving. + # @param name [String] The name for this endpoint gateway. The name must not be used by another endpoint + # gateway in the VPC. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @param security_groups [Array[SecurityGroupIdentity]] The security groups to use for this endpoint gateway. If unspecified, the VPC's @@ -13613,8 +14050,9 @@ def list_flow_log_collectors(start: nil, limit: nil, resource_group_id: nil, nam # the # target that are themselves the target of a more specific flow log collector. # @param active [Boolean] Indicates whether this collector will be active upon creation. - # @param name [String] The unique user-defined name for this flow log collector. If unspecified, the name - # will be a hyphenated list of randomly-selected words. + # @param name [String] The name for this flow log collector. The name must not be used by another flow + # log collector in the region. If unspecified, the name will be a hyphenated list of + # randomly-selected words. # @param resource_group [ResourceGroupIdentity] The resource group to use. If unspecified, the account's [default resource # group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response. diff --git a/test/examples/vpc_v1.rb b/test/examples/vpc_v1.rb new file mode 100644 index 0000000..8b85cde --- /dev/null +++ b/test/examples/vpc_v1.rb @@ -0,0 +1,4871 @@ +# frozen_string_literal: true + +require_relative "../test_helper.rb" +require "minitest/hooks/test" +require "ibm_cloud_sdk_core" +require "json" + +file_path = File.join(File.dirname(__FILE__), "../../vpc.env") +ENV["IBM_CREDENTIALS_FILE"] = file_path +if ENV["IBM_CREDENTIALS_FILE"] + class VpcV1Test < Minitest::Test + include Minitest::Hooks + attr_accessor :service, :vpc_id + + def before_all + authenticator = IbmVpc::Authenticators::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: "vpc") + config = get_service_properties("vpc") + url = config[:url] + self.service = IbmVpc::VpcV1.new(authenticator: authenticator, service_url: url) + end + + def test_vpcs + puts "create_vpc() result:" + # begin-create_vpc + + vpc = service.create_vpc(name: "my-vpc").result + # end-create_vpc + + vpc_id = vpc["id"] + assert vpc_id != "" + + puts "get_vpc() result:" + + # begin-get_vpc + + vpc = service.get_vpc(id: vpc_id).result + puts JSON.pretty_generate(vpc) + # end-get_vpc + + assert !vpc.nil? + assert vpc["id"] != "" + + puts "list_vpcs() result:" + + # begin-list_vpcs + + vpc_collection = service.list_vpcs.result + + puts JSON.pretty_generate(vpc_collection) + + # end-list_vpcs + + assert !vpc_collection.nil? + + puts "update_vpc() result:" + # begin-update_vpc + + vpc_patch_model = { name: "my-vpc-updated" } + + vpc = service.update_vpc( + id: vpc_id, vpc_patch: vpc_patch_model + ).result + + puts JSON.pretty_generate(vpc) + + # end-update_vpc + assert !vpc.nil? + + puts "get_vpc_default_network_acl() result:" + # begin-get_vpc_default_network_acl + + default_network_acl = service.get_vpc_default_network_acl(id: vpc_id).result + + puts JSON.pretty_generate(default_network_acl) + + # end-get_vpc_default_network_acl + assert !default_network_acl.nil? + + puts "get_vpc_default_routing_table() result:" + # begin-get_vpc_default_routing_table + + default_routing_table = service.get_vpc_default_routing_table(id: vpc_id).result + + puts JSON.pretty_generate(default_routing_table) + + # end-get_vpc_default_routing_table + assert !default_routing_table.nil? + + puts "get_vpc_default_security_group() result:" + # begin-get_vpc_default_security_group + + default_security_group = service.get_vpc_default_security_group(id: vpc_id).result + + puts JSON.pretty_generate(default_security_group) + + # end-get_vpc_default_security_group + assert !default_security_group.nil? + + # begin-delete_vpc + + service.delete_vpc(id: vpc_id) + # end-delete_vpc + end + + def test_vpcs_addess_prefix + vpc = service.create_vpc(name: "my-vpc-address-prefix").result + vpc_id = vpc["id"] + + puts "list_vpc_address_prefixes() result:" + # begin-list_vpc_address_prefixes + + address_prefix_collection = service.list_vpc_address_prefixes(vpc_id: vpc_id).result + + puts JSON.pretty_generate(address_prefix_collection) + + # end-list_vpc_address_prefixes + assert !address_prefix_collection.nil? + + puts "create_vpc_address_prefix() result:" + # begin-create_vpc_address_prefix + + zone_identity_model = { + 'name': "us-east-1" + } + + address_prefix = service.create_vpc_address_prefix( + vpc_id: vpc_id, + cidr: "10.0.0.0/24", + zone: zone_identity_model + ).result + address_prefix_id = address_prefix["id"] + puts JSON.pretty_generate(address_prefix) + + # end-create_vpc_address_prefix + assert !address_prefix.nil? + puts "get_vpc_address_prefix() result:" + # begin-get_vpc_address_prefix + + address_prefix = service.get_vpc_address_prefix( + vpc_id: vpc_id, id: address_prefix_id + ).result + + puts JSON.pretty_generate(address_prefix) + + # end-get_vpc_address_prefix + assert !address_prefix.nil? + + puts "update_vpc_address_prefix() result:" + # begin-update_vpc_address_prefix + + address_prefix_patch_model = { name: "updated-my-vpc-address-prefix" } + + address_prefix = service.update_vpc_address_prefix( + vpc_id: vpc_id, + id: address_prefix_id, + address_prefix_patch: address_prefix_patch_model + ).result + + puts JSON.pretty_generate(address_prefix) + + # end-update_vpc_address_prefix + assert !address_prefix.nil? + + # begin-delete_vpc_address_prefix + + service.delete_vpc_address_prefix( + vpc_id: vpc_id, id: address_prefix_id + ) + + # end-delete_vpc_address_prefix + + service.delete_vpc(id: vpc_id) + end + + def test_vpc_routing_tables_example + vpc = service.create_vpc(name: "my-vpc-routing-table").result + vpc_id = vpc["id"] + + puts "list_vpc_routing_tables() result:" + # begin-list_vpc_routing_tables + + vpc_routing_table_collection = service.list_vpc_routing_tables( + vpc_id: vpc_id + ).result + + puts JSON.pretty_generate(vpc_routing_table_collection) + + # end-list_vpc_routing_tables + assert !vpc_routing_table_collection.nil? + + puts "create_vpc_routing_table() result:" + # begin-create_vpc_routing_table + + vpc_routing_table = service.create_vpc_routing_table( + vpc_id: vpc_id, + name: "my-vpc-routing-table" + ).result + + puts JSON.pretty_generate(vpc_routing_table) + + # end-create_vpc_routing_table + routing_table_id = vpc_routing_table["id"] + assert !vpc_routing_table.nil? + + puts "get_vpc_routing_table() result:" + # begin-get_vpc_routing_table + + vpc_routing_table = service.get_vpc_routing_table( + vpc_id: vpc_id, id: routing_table_id + ).result + + puts JSON.pretty_generate(vpc_routing_table) + + # end-get_vpc_routing_table + assert !vpc_routing_table.nil? + + puts "update_vpc_routing_table() result:" + # begin-update_vpc_routing_table + + routing_table_patch_model = { name: "updated-my-vpc-routing-table" } + + vpc_routing_table = service.update_vpc_routing_table( + vpc_id: vpc_id, + id: routing_table_id, + routing_table_patch: routing_table_patch_model + ).result + + puts JSON.pretty_generate(vpc_routing_table) + + # end-update_vpc_routing_table + assert !vpc_routing_table.nil? + + # begin-delete_vpc_routing_table + + service.delete_vpc_routing_table(vpc_id: vpc_id, + id: routing_table_id) + + # end-delete_vpc_routing_table + + service.delete_vpc(id: vpc_id) + end + + def test_vpc_routing_table_routes_example + vpc = service.create_vpc(name: "my-vpc-routing-table-route").result + vpc_id = vpc["id"] + vpc_routing_table = service.create_vpc_routing_table( + vpc_id: vpc_id, + name: "my-vpc-routing-table-route" + ).result + + routing_table_id = vpc_routing_table["id"] + + puts "list_vpc_routing_table_routes() result:" + # begin-list_vpc_routing_table_routes + + vpc_routing_table_route_collection = service.list_vpc_routing_table_routes( + vpc_id: vpc_id, + routing_table_id: routing_table_id + ).result + + puts JSON.pretty_generate(vpc_routing_table_route_collection) + + # end-list_vpc_routing_table_routes + assert !vpc_routing_table_route_collection.nil? + + puts "create_vpc_routing_table_route() result:" + # begin-create_vpc_routing_table_route + + zone_identity_model = { + 'name': "us-east-1" + } + route_next_hop_ip = { + "address": "192.168.3.4" + } + vpc_routing_table_route = service.create_vpc_routing_table_route( + vpc_id: vpc_id, + routing_table_id: routing_table_id, + destination: "192.168.3.0/24", + zone: zone_identity_model, + name: "my-vpc-routing-table-route", + next_hop: route_next_hop_ip + ).result + + puts JSON.pretty_generate(vpc_routing_table_route) + + # end-create_vpc_routing_table_route + routing_table_route_id = vpc_routing_table_route["id"] + assert !vpc_routing_table_route.nil? + + puts "get_vpc_routing_table_route() result:" + # begin-get_vpc_routing_table_route + + vpc_routing_table_route = service.get_vpc_routing_table_route( + vpc_id: vpc_id, + routing_table_id: routing_table_id, + id: routing_table_route_id + ).result + + puts JSON.pretty_generate(vpc_routing_table_route) + + # end-get_vpc_routing_table_route + assert !vpc_routing_table_route.nil? + + puts "update_vpc_routing_table_route() result:" + # begin-update_vpc_routing_table_route + + route_patch_model = { name: "updated-my-vpc-routing-table-route" } + + vpc_routing_table_route = service.update_vpc_routing_table_route( + vpc_id: vpc_id, + routing_table_id: routing_table_id, + id: routing_table_route_id, + route_patch: route_patch_model + ).result + + puts JSON.pretty_generate(vpc_routing_table_route) + + # end-update_vpc_routing_table_route + assert !vpc_routing_table_route.nil? + + # begin-delete_vpc_routing_table_route + + service.delete_vpc_routing_table_route( + vpc_id: vpc_id, + routing_table_id: routing_table_id, + id: routing_table_route_id + ) + + # end-delete_vpc_routing_table_route + + service.delete_vpc_routing_table(vpc_id: vpc_id, + id: routing_table_id) + + service.delete_vpc(id: vpc_id) + end + + def test_subnets_example + vpc = service.create_vpc(name: "my-vpc-subnet").result + vpc_id = vpc["id"] + + puts "list_subnets() result" + # begin-list_subnets + + subnet_collection = service.list_subnets.result + + puts JSON.pretty_generate(subnet_collection) + + # end-list_subnets + assert !subnet_collection.nil? + + puts "create_subnet() result" + # begin-create_subnet + + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + + puts JSON.pretty_generate(subnet) + + # end-create_subnet + assert !subnet.nil? + subnet_id = subnet["id"] + + puts "get_subnet() result" + # begin-get_subnet + + subnet = service.get_subnet(id: subnet_id).result + + puts JSON.pretty_generate(subnet) + + # end-get_subnet + assert !subnet.nil? + + puts "update_subnet() result" + # begin-update_subnet + + subnet_patch_model = { 'name': "updated-my-subnet" } + + subnet = service.update_subnet( + id: subnet_id, subnet_patch: subnet_patch_model + ).result + + puts JSON.pretty_generate(subnet) + + # end-update_subnet + + vpc_identity_model = { + 'id': vpc_id + } + + network_acl_prototype_model = { + 'name': "my-subnet-network-acl-", + 'vpc': vpc_identity_model + } + + network_acl_id = service.create_network_acl( + network_acl_prototype: network_acl_prototype_model + ).result["id"] + + puts "get_subnet_network_acl() result" + # begin-get_subnet_network_acl + + network_acl = service.get_subnet_network_acl( + id: subnet_id + ).result + + puts JSON.pretty_generate(network_acl) + + # end-get_subnet_network_acl + + puts "replace_subnet_network_acl() result" + # begin-replace_subnet_network_acl + + network_acl_identity_model = { + 'id': network_acl_id + } + + network_acl = service.replace_subnet_network_acl( + id: subnet_id, + network_acl_identity: network_acl_identity_model + ).result + + puts JSON.pretty_generate(network_acl) + + # end-replace_subnet_network_acl + + vpc_identity_model = { + 'id': vpc_id + } + + zone_identity_model = { + 'name': "us-south-1" + } + + public_gateway_id = service.create_public_gateway( + vpc: vpc_identity_model, zone: zone_identity_model, + name: "my-subnet-public-gateway" + ).result["id"] + + puts "set_subnet_public_gateway() result" + # begin-set_subnet_public_gateway + + public_gateway_identity_model = { + 'id': public_gateway_id + } + + public_gateway = service.set_subnet_public_gateway( + id: subnet_id, + public_gateway_identity: public_gateway_identity_model + ).result + + puts JSON.pretty_generate(public_gateway) + + # end-set_subnet_public_gateway + + puts "get_subnet_public_gateway() result" + # begin-get_subnet_public_gateway + + public_gateway = service.get_subnet_public_gateway( + id: subnet_id + ).result + + puts JSON.pretty_generate(public_gateway) + + # end-get_subnet_public_gateway + + puts "unset_subnet_public_gateway() result" + # begin-unset_subnet_public_gateway + service.unset_subnet_public_gateway( + id: subnet_id + ) + # end-unset_subnet_public_gateway + + vpc_routing_table_id = service.create_vpc_routing_table( + vpc_id: vpc_id, + name: "my-vpc-subnet-routing-table" + ).result["id"] + + puts "get_subnet_routing_table() result" + # begin-get_subnet_routing_table + + routing_table = service.get_subnet_routing_table( + id: subnet_id + ).result + + puts JSON.pretty_generate(routing_table) + + # end-get_subnet_routing_table + + puts "replace_subnet_routing_table() result" + # begin-replace_subnet_routing_table + + routing_table_identity_model = { + 'id': vpc_routing_table_id + } + + routing_table = service.replace_subnet_routing_table( + id: subnet_id, + routing_table_identity: routing_table_identity_model + ).result + + puts JSON.pretty_generate(routing_table) + + # end-replace_subnet_routing_table + + # begin-list_subnet_reserved_ips + + reserved_ip_collection = service.list_subnet_reserved_ips( + subnet_id: subnet_id + ).result + + puts JSON.pretty_generate(reserved_ip_collection) + + # end-list_subnet_reserved_ips + + service.create_subnet_reserved_ip( + subnet_id: subnet_id, + name: "my-subnet-reservedip-dummy", + auto_delete: false + ).result + + # begin-create_subnet_reserved_ip + + reserved_ip = service.create_subnet_reserved_ip( + subnet_id: subnet_id + ).result + + puts JSON.pretty_generate(reserved_ip) + + # end-create_subnet_reserved_ip + reserved_ip_id = reserved_ip["id"] + + # begin-get_subnet_reserved_ip + + reserved_ip = service.get_subnet_reserved_ip( + subnet_id: subnet_id, + id: reserved_ip_id + ).result + + puts JSON.pretty_generate(reserved_ip) + + # end-get_subnet_reserved_ip + + # begin-update_subnet_reserved_ip + + reserved_ip_patch_model = { + 'name': "my-subnet-reserved-ip-updated" + } + + reserved_ip = service.update_subnet_reserved_ip( + subnet_id: subnet_id, + id: reserved_ip_id, + reserved_ip_patch: reserved_ip_patch_model + ).result + + puts JSON.pretty_generate(reserved_ip) + + # end-update_subnet_reserved_ip + + # begin-delete_subnet_reserved_ip + + service.delete_subnet_reserved_ip( + subnet_id: subnet_id, + id: reserved_ip_id + ) + + # end-delete_subnet_reserved_ip + + puts "delete_subnet() result" + # begin-delete_subnet + + service.delete_subnet(id: subnet_id) + + # end-delete_subnet + + # sleep(60) + service.delete_vpc(id: vpc_id) + end + + def test_subnets_reserved_ips_example + vpc = service.create_vpc(name: "my-vpc-subnet-reservedips").result + vpc_id = vpc["id"] + + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-reserved-ips" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + + subnet_id = subnet["id"] + + puts "list_subnet_reserved_ips() result" + # begin-list_subnet_reserved_ips + + subnet_reserved_ip_collection = service.list_subnet_reserved_ips( + subnet_id: subnet_id, sort: "name" + ).result + + puts JSON.pretty_generate(subnet_reserved_ip_collection) + + # end-list_subnet_reserved_ips + assert !subnet_reserved_ip_collection.nil? + + service.create_subnet_reserved_ip( + subnet_id: subnet_id, + name: "my-subnet-reservedip-dummy", + auto_delete: false + ).result + + puts "create_subnet_reserved_ip() result" + # begin-create_subnet_reserved_ip + + subnet_reserved_ip = service.create_subnet_reserved_ip( + subnet_id: subnet_id, + name: "my-subnet-reservedip", + auto_delete: false, + address: "192.168.3.4" + ).result + + puts JSON.pretty_generate(subnet_reserved_ip) + + # end-create_subnet_reserved_ip + assert !subnet_reserved_ip.nil? + subnet_reserved_ip_id = subnet_reserved_ip["id"] + + puts "get_subnet_reserved_ip() result" + # begin-get_subnet_reserved_ip + + subnet_reserved_ip = service.get_subnet_reserved_ip( + subnet_id: subnet_id, id: subnet_reserved_ip_id + ).result + + puts JSON.pretty_generate(subnet_reserved_ip) + + # end-get_subnet_reserved_ip + + puts "update_subnet_reserved_ip() result" + # begin-update_subnet_reserved_ip + + reserved_ip_patch_model = { name: "my-subnet-reservedip-updated" } + + subnet_reserved_ip = service.update_subnet_reserved_ip( + subnet_id: subnet_id, + id: subnet_reserved_ip_id, + reserved_ip_patch: reserved_ip_patch_model + ).result + + puts JSON.pretty_generate(subnet_reserved_ip) + + # end-update_subnet_reserved_ip + assert !subnet_reserved_ip.nil? + + # begin-delete_subnet_reserved_ip + + service.delete_subnet_reserved_ip( + subnet_id: subnet_id, id: subnet_reserved_ip_id + ) + + # end-delete_subnet_reserved_ip + + service.delete_subnet(id: subnet_id) + + # sleep(60) + service.delete_vpc(id: vpc_id) + end + + def test_images_example + puts "list_images() result" + # begin-list_images + + image_collection = service.list_images.result + + puts JSON.pretty_generate(image_collection) + + # end-list_images + assert !image_collection.nil? + + puts "create_image() result" + # begin-create_image + + image_file_prototype_model = { + 'href': "cos://us-east/my-bucket/my-image.qcow2" + } + + operating_system_identity_model = { + 'name': "debian-9-amd64" + } + + image_prototype_model = { + 'file': image_file_prototype_model, + 'operating_system': operating_system_identity_model, + 'name': "my-image" + } + + image = service.create_image( + image_prototype: image_prototype_model + ).result + + puts JSON.pretty_generate(image) + + # end-create_image + + image_id = image["id"] + + puts "get_image() result" + # begin-get_image + + image = service.get_image(id: image_id).result + + puts JSON.pretty_generate(image) + + # end-get_image + assert !image.nil? + + puts "update_image() result" + # begin-update_image + + image_patch_model = { name: "updated-my-image" } + + image = service.update_image( + id: image_id, image_patch: image_patch_model + ).result + + puts JSON.pretty_generate(image) + + # end-update_image + assert !image.nil? + + # begin-delete_image + + service.delete_image(id: image_id) + + # end-delete_image + + puts "list_operating_systems() result" + # begin-list_operating_systems + + operating_system_collection = service.list_operating_systems.result + + puts JSON.pretty_generate(operating_system_collection) + + # end-list_operating_systems + assert !operating_system_collection.nil? + operating_system = operating_system_collection["operating_systems"][0]["name"] + puts "get_operating_system() result:" + # begin-get_operating_system + + operating_system = service.get_operating_system( + name: operating_system + ).result + + puts JSON.pretty_generate(operating_system) + + # end-get_operating_system + end + + def test_keys_example + puts "list_keys() result" + # begin-list_keys + + key_collection = service.list_keys.result + + puts JSON.pretty_generate(key_collection) + + # end-list_keys + + puts "create_key() result" + # begin-create_key + + key = service.create_key( + name: "my-key", + public_key: + "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En" + ).result + + puts JSON.pretty_generate(key) + + # end-create_key + + key_id = key["id"] + + puts "get_key() result" + # begin-get_key + + key = service.get_key(id: key_id).result + + puts JSON.pretty_generate(key) + + # end-get_key + + puts "update_key() result" + # begin-update_key + + key_patch_model = { name: "updated-my-key" } + + key = service.update_key( + id: key_id, key_patch: key_patch_model + ).result + + puts JSON.pretty_generate(key) + + # end-update_key + + # begin-delete_key + + service.delete_key(id: key_id) + + # end-delete_key + end + + def test_instance_profile_example + puts "list_instance_profiles() result:" + # begin-list_instance_profiles + + profile_collection = service.list_instance_profiles.result + + puts JSON.pretty_generate(profile_collection) + + # end-list_instance_profiles + + puts "get_instance_profile() result:" + # begin-get_instance_profile + + profile = service.get_instance_profile( + name: "bx2-2x8" + ).result + + puts JSON.pretty_generate(profile) + + # end-get_instance_profile + end + + def test_instance_template_example + vpc = service.create_vpc(name: "my-vpc-template").result + vpc_id = vpc["id"] + + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-instance-template" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + + subnet_id = subnet["id"] + + images = service.list_images.result["images"] + image_id = images[5]["id"] + + profile_name = service.list_instance_profiles.result["profiles"][1]["name"] + + puts "list_instance_templates() result:" + # begin-list_instance_templates + + instance_template_collection = service.list_instance_templates + .result + + puts JSON.pretty_generate(instance_template_collection) + + # end-list_instance_templates + + puts "create_instance_template() result:" + + # begin-create_instance_template + + instance_profile_identity_model = { + 'name': profile_name + } + + vpc_identity_model = { + 'id': vpc_id + } + + image_identity_model = { + 'id': image_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface_prototype_model = { + 'subnet': subnet_identity_model + } + + zone_identity_model = { + 'name': "us-east-1" + } + + instance_template_prototype_model = { + 'name': "my-instance-template", + 'profile': instance_profile_identity_model, + 'vpc': vpc_identity_model, + 'image': image_identity_model, + 'primary_network_interface': network_interface_prototype_model, + 'zone': zone_identity_model + } + + instance_template = service.create_instance_template( + instance_template_prototype: instance_template_prototype_model + ).result + + puts JSON.pretty_generate(instance_template) + + # end-create_instance_template + instance_template_id = instance_template["id"] + puts "get_instance_template() result:" + # begin-get_instance_template + + instance_template = service.get_instance_template( + id: instance_template_id + ).result + + puts JSON.pretty_generate(instance_template) + + # end-get_instance_template + + puts "update_instance_template() result:" + # begin-update_instance_template + + instance_template_patch_model = { name: "updated-my-instance-template" } + + instance_template = service.update_instance_template( + id: instance_template_id, + instance_template_patch: instance_template_patch_model + ).result + + puts JSON.pretty_generate(instance_template) + + # end-update_instance_template + + # begin-delete_instance_template + + service.delete_instance_template(id: instance_template_id) + + # end-delete_instance_template + + # sleep(30) + + service.delete_subnet(id: subnet_id) + + # sleep(60) + service.delete_vpc(id: vpc_id) + end + + def test_instance_example + vpc = service.create_vpc(name: "my-vpc-instance").result + vpc_id = vpc["id"] + + key = service.create_key( + name: "my-key-instance", + public_key: + "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En" + ).result + + key_id = key["id"] + + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-instance" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + + subnet_id = subnet["id"] + + images = service.list_images.result["images"] + image_id = images[5]["id"] + + puts "list_instances() result:" + # begin-list_instances + + instance_collection = service.list_instances.result + + puts JSON.pretty_generate(instance_collection) + + # end-list_instances + + puts "create_instance() result:" + # begin-create_instance + + instance_profile_identity_model = { + 'name': "bx2d-8x32" + } + key_identity_model = { + 'id': key_id + } + + vpc_identity_model = { + 'id': vpc_id + } + + volume_attachment_prototype_instance_by_image_context_model = { + 'volume': { + 'name': "my-boot-volume", + 'profile': { + 'name': "general-purpose" + } + } + } + + image_identity_model = { + 'id': image_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface_prototype_model = { + 'name': "my-network-interface", + 'subnet': subnet_identity_model + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_attachment_prototype_model = { + 'delete_volume_on_instance_delete': true, + 'volume': { + 'capacity': 1000, + 'name': "my-data-volume", + 'profile': { + 'name': "5iops-tier" + } + } + } + + instance_prototype_model = { + 'keys': [key_identity_model], + 'name': "my-instance", + + 'profile': instance_profile_identity_model, + 'volume_attachments': [volume_attachment_prototype_model], + 'vpc': vpc_identity_model, + 'boot_volume_attachment': volume_attachment_prototype_instance_by_image_context_model, + 'image': image_identity_model, + 'primary_network_interface': network_interface_prototype_model, + 'zone': zone_identity_model + } + + instance = service.create_instance( + instance_prototype: instance_prototype_model + ).result + + puts JSON.pretty_generate(instance) + + # end-create_instance + + instance_id = instance["id"] + + puts "get_instance() result:" + # begin-get_instance + + instance = service.get_instance(id: instance_id).result + + puts JSON.pretty_generate(instance) + + # end-get_instance + + puts "update_instance() result:" + # begin-update_instance + + instance_patch_model = { name: "updated-my-instance" } + + instance = service.update_instance( + id: instance_id, + instance_patch: instance_patch_model + ).result + + puts JSON.pretty_generate(instance) + + # end-update_instance + + puts "get_instance_initialization() result:" + # begin-get_instance_initialization + + instance_initialization = service.get_instance_initialization( + id: instance_id + ).result + + puts JSON.pretty_generate(instance_initialization) + + # end-get_instance_initialization + # sleep(30) + puts "create_instance_action() result:" + # begin-create_instance_action + + instance_action = service.create_instance_action( + instance_id: instance_id, type: "stop" + ).result + + puts JSON.pretty_generate(instance_action) + + # end-create_instance_action + + # puts "create_instance_console_access_token() result:" + # begin-create_instance_console_access_token + + # instance_console_access_token = service.create_instance_console_access_token( + # instance_id: instance_id, console_type: "serial" + # ).result + + # puts JSON.pretty_generate(instance_console_access_token) + + # end-create_instance_console_access_token + + puts "list_instance_disks() result:" + # begin-list_instance_disks + + instance_disk_collection = service.list_instance_disks( + instance_id: instance_id + ).result + + puts JSON.pretty_generate(instance_disk_collection) + + # end-list_instance_disks + + disk_id = instance_disk_collection["disks"][0]["id"] + + puts "get_instance_disk() result:" + # begin-get_instance_disk + + instance_disk = service.get_instance_disk( + instance_id: instance_id, id: disk_id + ).result + + puts JSON.pretty_generate(instance_disk) + # end-get_instance_disk + + puts "update_instance_disk() result:" + # begin-update_instance_disk + + instance_disk_patch_model = { name: "updated-instance-disk" } + + instance_disk = service.update_instance_disk( + instance_id: instance_id, + id: disk_id, + instance_disk_patch: instance_disk_patch_model + ).result + + puts JSON.pretty_generate(instance_disk) + + # end-update_instance_disk + + puts "list_instance_network_interfaces() result:" + # begin-list_instance_network_interfaces + + network_interface_unpaginated_collection = service.list_instance_network_interfaces( + instance_id: instance_id + ).result + + puts JSON.pretty_generate(network_interface_unpaginated_collection) + + # end-list_instance_network_interfaces + + puts "create_instance_network_interface() result:" + # begin-create_instance_network_interface + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface = service.create_instance_network_interface( + instance_id: instance_id, + subnet: subnet_identity_model + ).result + + puts JSON.pretty_generate(network_interface) + + # end-create_instance_network_interface + network_interface_id = network_interface["id"] + + puts "get_instance_network_interface() result:" + # begin-get_instance_network_interface + + network_interface = service.get_instance_network_interface( + instance_id: instance_id, id: network_interface_id + ).result + + puts JSON.pretty_generate(network_interface) + + # end-get_instance_network_interface + + puts "update_instance_network_interface() result:" + # begin-update_instance_network_interface + + network_interface_patch_model = { + 'name': "updated-network-interface" + } + + network_interface = service.update_instance_network_interface( + instance_id: instance_id, + id: network_interface_id, + network_interface_patch: network_interface_patch_model + ).result + + puts JSON.pretty_generate(network_interface) + + # end-update_instance_network_interface + + zone_identity_model = { + 'name': "us-east-1" + } + + floating_ip_prototype_model = { + 'zone': zone_identity_model + } + + floating_ip = service.create_floating_ip( + floating_ip_prototype: floating_ip_prototype_model + ).result + floating_ip_id = floating_ip["id"] + + puts "add_instance_network_interface_floating_ip() result:" + # begin-add_instance_network_interface_floating_ip + + floating_ip = service.add_instance_network_interface_floating_ip( + instance_id: instance_id, + network_interface_id: network_interface_id, + id: floating_ip_id + ).result + + puts JSON.pretty_generate(floating_ip) + + # end-add_instance_network_interface_floating_ip + + puts "list_instance_network_interface_floating_ips() result:" + # begin-list_instance_network_interface_floating_ips + + floating_ip_unpaginated_collection = service.list_instance_network_interface_floating_ips( + instance_id: instance_id, + network_interface_id: network_interface_id + ).result + + puts JSON.pretty_generate(floating_ip_unpaginated_collection) + + # end-list_instance_network_interface_floating_ips + + puts "get_instance_network_interface_floating_ip() result:" + # begin-get_instance_network_interface_floating_ip + + floating_ip = service.get_instance_network_interface_floating_ip( + instance_id: instance_id, + network_interface_id: network_interface_id, + id: floating_ip_id + ).result + + puts JSON.pretty_generate(floating_ip) + + # end-get_instance_network_interface_floating_ip + + puts "list_instance_volume_attachments() result:" + # begin-list_instance_volume_attachments + + volume_attachment_collection = service.list_instance_volume_attachments( + instance_id: instance_id + ).result + + puts JSON.pretty_generate(volume_attachment_collection) + + # end-list_instance_volume_attachments + + puts "create_instance_volume_attachment() result:" + # begin-create_instance_volume_attachment + + volume_attachment_prototype_model = { + + 'capacity': 1000, + 'name': "my-data-volume-2", + 'profile': { + 'name': "5iops-tier" + } + + } + + volume_attachment = service.create_instance_volume_attachment( + instance_id: instance_id, + volume: volume_attachment_prototype_model, + delete_volume_on_instance_delete: true + ).result + + puts JSON.pretty_generate(volume_attachment) + + # end-create_instance_volume_attachment + volume_attachment_id = volume_attachment["id"] + + puts "get_instance_volume_attachment() result:" + # begin-get_instance_volume_attachment + + volume_attachment = service.get_instance_volume_attachment( + instance_id: instance_id, id: volume_attachment_id + ).result + + puts JSON.pretty_generate(volume_attachment) + + # end-get_instance_volume_attachment + + puts "update_instance_volume_attachment() result:" + # begin-update_instance_volume_attachment + + volume_attachment_patch_model = { name: "updated-volume-attachment" } + + volume_attachment = service.update_instance_volume_attachment( + instance_id: instance_id, + id: volume_attachment_id, + volume_attachment_patch: volume_attachment_patch_model + ).result + + puts JSON.pretty_generate(volume_attachment) + + # end-update_instance_volume_attachment + + puts "delete_instance_volume_attachment() result:" + # begin-delete_instance_volume_attachment + + service.delete_instance_volume_attachment( + instance_id: instance_id, id: volume_attachment_id + ) + + # end-delete_instance_volume_attachment + + puts "remove_instance_network_interface_floating_ip() result:" + # begin-remove_instance_network_interface_floating_ip + + service.remove_instance_network_interface_floating_ip( + instance_id: instance_id, + network_interface_id: network_interface_id, + id: floating_ip_id + ) + + # end-remove_instance_network_interface_floating_ip + + puts "delete_instance_network_interface() result:" + # begin-delete_instance_network_interface + + service.delete_instance_network_interface( + instance_id: instance_id, id: network_interface_id + ) + + # end-delete_instance_network_interface + + puts "delete_instance() result:" + # begin-delete_instance + + response = service.delete_instance(id: instance_id) + puts response + # end-delete_instance + # sleep(30) + service.delete_subnet(id: subnet_id) + + # sleep(60) + service.delete_vpc(id: vpc_id) + service.delete_key(id: key_id) + end + + def test_instance_group_example + vpc = service.create_vpc(name: "my-vpc-group").result + vpc_id = vpc["id"] + + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-2" + }, + 'name': "my-subnet-instance-group" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + + subnet_id = subnet["id"] + + images = service.list_images.result["images"] + image_id = images[5]["id"] + + profile_name = service.list_instance_profiles.result["profiles"][1]["name"] + + instance_profile_identity_model = { + 'name': profile_name + } + + vpc_identity_model = { + 'id': vpc_id + } + + image_identity_model = { + 'id': image_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface_prototype_model = { + 'subnet': subnet_identity_model + } + + zone_identity_model = { + 'name': "us-east-1" + } + + instance_template_prototype_model = { + 'name': "my-instance-template-instance-group", + 'profile': instance_profile_identity_model, + 'vpc': vpc_identity_model, + 'image': image_identity_model, + 'primary_network_interface': network_interface_prototype_model, + 'zone': zone_identity_model + } + + instance_template = service.create_instance_template( + instance_template_prototype: instance_template_prototype_model + ).result + instance_template_id = instance_template["id"] + puts "list_instance_groups() result:" + # begin-list_instance_groups + + instance_group_collection = service.list_instance_groups + .result + + puts JSON.pretty_generate(instance_group_collection) + + # end-list_instance_groups + + puts "create_instance_group() result:" + # begin-create_instance_group + + instance_template_identity_model = { + 'id': instance_template_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + instance_group = service.create_instance_group( + instance_template: instance_template_identity_model, + subnets: [subnet_identity_model], + membership_count: 2, + name: "my-instance-group" + ).result + + puts JSON.pretty_generate(instance_group) + + # end-create_instance_group + instance_group_id = instance_group["id"] + # sleep(30) + + puts "get_instance_group() result:" + # begin-get_instance_group + + instance_group = service.get_instance_group( + id: instance_group_id + ).result + + puts JSON.pretty_generate(instance_group) + + # end-get_instance_group + + puts "update_instance_group() result:" + # begin-update_instance_group + + instance_group_patch_model = { name: "updated-instance-group" } + + instance_group = service.update_instance_group( + id: instance_group_id, + instance_group_patch: instance_group_patch_model + ).result + + puts JSON.pretty_generate(instance_group) + + # end-update_instance_group + + # sleep(30) + + puts "list_instance_group_managers() result:" + # begin-list_instance_group_managers + + instance_group_manager_collection = service.list_instance_group_managers( + instance_group_id: instance_group_id + ).result + + puts JSON.pretty_generate(instance_group_manager_collection) + + # end-list_instance_group_managers + + puts "create_instance_group_manager() result:" + # begin-create_instance_group_manager + + instance_group_manager_prototype_model = { + 'manager_type': "scheduled" + } + + instance_group_manager = service.create_instance_group_manager( + instance_group_id: instance_group_id, + instance_group_manager_prototype: + instance_group_manager_prototype_model + ).result + + puts JSON.pretty_generate(instance_group_manager) + + # end-create_instance_group_manager + instance_group_manager_id = instance_group_manager["id"] + # sleep(30) + puts "get_instance_group_manager() result:" + # begin-get_instance_group_manager + + instance_group_manager = service.get_instance_group_manager( + instance_group_id: instance_group_id, id: instance_group_manager_id + ).result + + puts JSON.pretty_generate(instance_group_manager) + + # end-get_instance_group_manager + + puts "update_instance_group_manager() result:" + # begin-update_instance_group_manager + + instance_group_manager_patch_model = { name: "updated-instance-group-manager" } + + instance_group_manager = service.update_instance_group_manager( + instance_group_id: instance_group_id, + id: instance_group_manager_id, + instance_group_manager_patch: instance_group_manager_patch_model + ).result + + puts JSON.pretty_generate(instance_group_manager) + + # end-update_instance_group_manager + # sleep(30) + + puts "list_instance_group_manager_actions() result:" + # begin-list_instance_group_manager_actions + + instance_group_manager_actions_collection = service.list_instance_group_manager_actions( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id + ).result + + puts JSON.pretty_generate(instance_group_manager_actions_collection) + + # end-list_instance_group_manager_actions + + puts "create_instance_group_manager_action() result:" + # begin-create_instance_group_manager_action + + instance_group_manager_scheduled_action_group_prototype_model = { + 'membership_count': 2 + } + + instance_group_manager_action_prototype_model = { + 'group': + instance_group_manager_scheduled_action_group_prototype_model + } + + instance_group_manager_action = service.create_instance_group_manager_action( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + instance_group_manager_action_prototype: + instance_group_manager_action_prototype_model + ).result + + puts JSON.pretty_generate(instance_group_manager_action) + + # end-create_instance_group_manager_action + instance_group_manager_action_id = instance_group_manager_action["id"] + # sleep(30) + puts "get_instance_group_manager_action() result:" + # begin-get_instance_group_manager_action + + instance_group_manager_action = service.get_instance_group_manager_action( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + id: instance_group_manager_action_id + ).result + + puts JSON.pretty_generate(instance_group_manager_action) + + # end-get_instance_group_manager_action + + puts "update_instance_group_manager_action() result:" + # begin-update_instance_group_manager_action + + instance_group_manager_action_patch_model = { name: "updated-instance-group-manager-action" } + + instance_group_manager_action = service.update_instance_group_manager_action( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + id: instance_group_manager_action_id, + instance_group_manager_action_patch: + instance_group_manager_action_patch_model + ).result + + puts JSON.pretty_generate(instance_group_manager_action) + + # end-update_instance_group_manager_action + # sleep(30) + puts "list_instance_group_manager_policies() result:" + # begin-list_instance_group_manager_policies + + instance_group_manager_policy_collection = service.list_instance_group_manager_policies( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id + ).result + + puts JSON.pretty_generate(instance_group_manager_policy_collection) + + # end-list_instance_group_manager_policies + + puts "create_instance_group_manager_policy() result:" + # begin-create_instance_group_manager_policy + + instance_group_manager_policy_prototype_model = { + 'metric_type': "cpu", + 'metric_value': 38, + 'policy_type': "target" + } + + instance_group_manager_policy = service.create_instance_group_manager_policy( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + instance_group_manager_policy_prototype: + instance_group_manager_policy_prototype_model + ).result + + puts JSON.pretty_generate(instance_group_manager_policy) + + # end-create_instance_group_manager_policy + instance_group_manager_policy_id = instance_group_manager_policy["id"] + # sleep(30) + puts "get_instance_group_manager_policy() result:" + # begin-get_instance_group_manager_policy + + instance_group_manager_policy = service.get_instance_group_manager_policy( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + id: instance_group_manager_policy_id + ).result + + puts JSON.pretty_generate(instance_group_manager_policy) + + # end-get_instance_group_manager_policy + + puts "update_instance_group_manager_policy() result:" + # begin-update_instance_group_manager_policy + + instance_group_manager_policy_patch_model = { name: "updated-instance-group-manager-policy" } + + instance_group_manager_policy = service.update_instance_group_manager_policy( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + id: instance_group_manager_policy_id, + instance_group_manager_policy_patch: + instance_group_manager_policy_patch_model + ).result + + puts JSON.pretty_generate(instance_group_manager_policy) + + # end-update_instance_group_manager_policy + # sleep(30) + puts "list_instance_group_memberships() result:" + # begin-list_instance_group_memberships + + instance_group_membership_collection = service.list_instance_group_memberships( + instance_group_id: instance_group_id + ).result + + puts JSON.pretty_generate(instance_group_membership_collection) + + # end-list_instance_group_memberships + instance_group_membership_id = instance_group_membership_collection["memberships"][0]["id"] + puts "get_instance_group_membership() result:" + # begin-get_instance_group_membership + + instance_group_membership = service.get_instance_group_membership( + instance_group_id: instance_group_id, id: instance_group_membership_id + ).result + + puts JSON.pretty_generate(instance_group_membership) + + # end-get_instance_group_membership + + puts "update_instance_group_membership() result:" + # begin-update_instance_group_membership + + instance_group_membership_patch_model = { name: "updated-instance-group-membership" } + + instance_group_membership = service.update_instance_group_membership( + instance_group_id: instance_group_id, + id: instance_group_membership_id, + instance_group_membership_patch: + instance_group_membership_patch_model + ).result + + puts JSON.pretty_generate(instance_group_membership) + + # end-update_instance_group_membership + # sleep(30) + # begin-delete_instance_group_membership + + service.delete_instance_group_membership( + instance_group_id: instance_group_id, id: instance_group_membership_id + ) + + # end-delete_instance_group_membership + # sleep(30) + # begin-delete_instance_group_memberships + + service.delete_instance_group_memberships( + instance_group_id: instance_group_id + ) + + # end-delete_instance_group_memberships + # sleep(30) + # begin-delete_instance_group_manager_policy + + service.delete_instance_group_manager_policy( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + id: instance_group_manager_policy_id + ) + + # end-delete_instance_group_manager_policy + # sleep(30) + # begin-delete_instance_group_manager_action + + service.delete_instance_group_manager_action( + instance_group_id: instance_group_id, + instance_group_manager_id: instance_group_manager_id, + id: instance_group_manager_action_id + ) + + # end-delete_instance_group_manager_action + # sleep(30) + # begin-delete_instance_group_manager + + service.delete_instance_group_manager( + instance_group_id: instance_group_id, id: instance_group_manager_id + ) + + # end-delete_instance_group_manager + # sleep(30) + # begin-delete_instance_group_load_balancer + + # service.delete_instance_group_load_balancer( + # instance_group_id: instance_group_id + # ) + + # end-delete_instance_group_load_balancer + # sleep(30) + # begin-delete_instance_group + + service.delete_instance_group(id: instance_group_id) + + # end-delete_instance_group + end + + def test_dedicated_host_example + puts "list_dedicated_host_groups() result:" + # begin-list_dedicated_host_groups + + dedicated_host_group_collection = service.list_dedicated_host_groups + .result + + puts JSON.pretty_generate(dedicated_host_group_collection) + + # end-list_dedicated_host_groups + + puts "create_dedicated_host_group() result:" + # begin-create_dedicated_host_group + + zone_identity_model = { + 'name': "us-east-1" + } + + dedicated_host_group = service.create_dedicated_host_group( + _class: "mx2", family: "balanced", zone: zone_identity_model, + name: "example_dedicated_host_group" + ).result + + puts JSON.pretty_generate(dedicated_host_group) + + # end-create_dedicated_host_group + dedicated_host_group_id = dedicated_host_group["id"] + + puts "get_dedicated_host_group() result:" + # begin-get_dedicated_host_group + + dedicated_host_group = service.get_dedicated_host_group( + id: dedicated_host_group_id + ).result + + puts JSON.pretty_generate(dedicated_host_group) + + # end-get_dedicated_host_group + + puts "update_dedicated_host_group() result:" + # begin-update_dedicated_host_group + + dedicated_host_group_patch_model = { + 'name': "updated-my-host-group" + } + + dedicated_host_group = service.update_dedicated_host_group( + id: dedicated_host_group_id, + dedicated_host_group_patch: dedicated_host_group_patch_model + ).result + + puts JSON.pretty_generate(dedicated_host_group) + + # end-update_dedicated_host_group + + puts "list_dedicated_host_profiles() result:" + # begin-list_dedicated_host_profiles + + dedicated_host_profile_collection = service.list_dedicated_host_profiles + .result + + puts JSON.pretty_generate(dedicated_host_profile_collection) + + # end-list_dedicated_host_profiles + dedicated_host_profile = dedicated_host_profile_collection["profiles"][0]["name"] + puts "get_dedicated_host_profile() result:" + # begin-get_dedicated_host_profile + + dedicated_host_profile = service.get_dedicated_host_profile( + name: dedicated_host_profile + ).result + + puts JSON.pretty_generate(dedicated_host_profile) + + # end-get_dedicated_host_profile + + puts "list_dedicated_hosts() result:" + # begin-list_dedicated_hosts + + dedicated_host_collection = service.list_dedicated_hosts + .result + + puts JSON.pretty_generate(dedicated_host_collection) + + # end-list_dedicated_hosts + + puts "create_dedicated_host() result:" + # begin-create_dedicated_host + + dedicated_host_profile_identity_model = { + 'name': "mx2d-host-152x1216" + } + + dedicated_host_group_identity_model = { + 'id': dedicated_host_group_id + } + + dedicated_host_prototype_model = { + 'profile': dedicated_host_profile_identity_model, + 'group': dedicated_host_group_identity_model, + 'name': "example_dedicated_host" + } + + dedicated_host = service.create_dedicated_host( + dedicated_host_prototype: dedicated_host_prototype_model + ).result + + puts JSON.pretty_generate(dedicated_host) + + # end-create_dedicated_host + dedicated_host_id = dedicated_host["id"] + + puts "list_dedicated_host_disks() result:" + # begin-list_dedicated_host_disks + + dedicated_host_disk_collection = service.list_dedicated_host_disks( + dedicated_host_id: dedicated_host_id + ).result + + puts JSON.pretty_generate(dedicated_host_disk_collection) + + # end-list_dedicated_host_disks + dedicated_host_disk_id = dedicated_host_disk_collection["disks"][0]["id"] + + puts "get_dedicated_host_disk() result:" + # begin-get_dedicated_host_disk + + dedicated_host_disk = service.get_dedicated_host_disk( + dedicated_host_id: dedicated_host_id, id: dedicated_host_disk_id + ).result + + puts JSON.pretty_generate(dedicated_host_disk) + + # end-get_dedicated_host_disk + + puts "update_dedicated_host_disk() result:" + # begin-update_dedicated_host_disk + + dedicated_host_disk_patch_model = { name: "updated-dedicated-host-disk" } + + dedicated_host_disk = service.update_dedicated_host_disk( + dedicated_host_id: dedicated_host_id, + id: dedicated_host_disk_id, + dedicated_host_disk_patch: dedicated_host_disk_patch_model + ).result + + puts JSON.pretty_generate(dedicated_host_disk) + + # end-update_dedicated_host_disk + + puts "get_dedicated_host() result:" + # begin-get_dedicated_host + + dedicated_host = service.get_dedicated_host( + id: dedicated_host_id + ).result + + puts JSON.pretty_generate(dedicated_host) + + # end-get_dedicated_host + + puts "update_dedicated_host() result:" + # begin-update_dedicated_host + + dedicated_host_patch_model = { name: "updated-my-dedicated-host" } + + dedicated_host = service.update_dedicated_host( + id: dedicated_host_id, + dedicated_host_patch: dedicated_host_patch_model + ).result + + puts JSON.pretty_generate(dedicated_host) + + # end-update_dedicated_host + + # begin-delete_dedicated_host + + service.delete_dedicated_host(id: dedicated_host_id) + + # end-delete_dedicated_host + + # begin-delete_dedicated_host_group + + service.delete_dedicated_host_group(id: dedicated_host_group_id) + + # end-delete_dedicated_host_group + end + + def test_placement_group_example + puts "list_placement_groups() result:" + # begin-list_placement_groups + + placement_group_collection = service.list_placement_groups + .result + + puts JSON.pretty_generate(placement_group_collection) + + # end-list_placement_groups + + puts "create_placement_group() result:" + # begin-create_placement_group + + placement_group = service.create_placement_group( + strategy: "host_spread", + name: "my-placement-grou[" + ).result + + puts JSON.pretty_generate(placement_group) + + # end-create_placement_group + placement_group_id = placement_group["id"] + + puts "get_placement_group() result:" + # begin-get_placement_group + + placement_group = service.get_placement_group( + id: placement_group_id + ).result + + puts JSON.pretty_generate(placement_group) + + # end-get_placement_group + + puts "update_placement_group() result:" + # begin-update_placement_group + + placement_group_patch_model = { name: "updated-my-placement-group" } + + placement_group = service.update_placement_group( + id: placement_group_id, + placement_group_patch: placement_group_patch_model + ).result + + puts JSON.pretty_generate(placement_group) + + # end-update_placement_group + + # begin-delete_placement_group + + service.delete_placement_group( + id: placement_group_id + ) + + # end-delete_placement_group + end + + def test_volumes_example + puts "list_volume_profiles() result:" + # begin-list_volume_profiles + + volume_profile_collection = service.list_volume_profiles + .result + + puts JSON.pretty_generate(volume_profile_collection) + + # end-list_volume_profiles + volume_profile = volume_profile_collection["profiles"][0]["id"] + puts "get_volume_profile() result:" + # begin-get_volume_profile + + volume_profile = service.get_volume_profile( + name: volume_profile + ).result + + puts JSON.pretty_generate(volume_profile) + + # end-get_volume_profile + + puts "list_volumes() result:" + # begin-list_volumes + + volume_collection = service.list_volumes.result + + puts JSON.pretty_generate(volume_collection) + + # end-list_volumes + + puts "create_volume() result:" + # begin-create_volume + + volume_profile_identity_model = { + 'name': "5iops-tier" + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_prototype_model = { + 'profile': volume_profile_identity_model, + 'zone': zone_identity_model, + 'capacity': 100, + 'name': "my-volume" + } + + volume = service.create_volume( + volume_prototype: volume_prototype_model + ).result + + puts JSON.pretty_generate(volume) + + # end-create_volume + volume_id = volume["id"] + + puts "get_volume() result:" + # begin-get_volume + + volume = service.get_volume(id: volume_id).result + + puts JSON.pretty_generate(volume) + + # end-get_volume + + puts "update_volume() result:" + # begin-update_volume + + volume_patch_model = { name: "updated-my-volume" } + + volume = service.update_volume( + id: volume_id, volume_patch: volume_patch_model + ).result + + puts JSON.pretty_generate(volume) + + # end-update_volume + + # begin-delete_volume + + service.delete_volume(id: volume_id) + + # end-delete_volume + end + + def test_snapshot_example + volume_profile_identity_model = { + 'name': "5iops-tier" + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_prototype_model = { + 'profile': volume_profile_identity_model, + 'zone': zone_identity_model, + 'capacity': 100, + 'name': "my-volume-snapshot" + } + + volume = service.create_volume( + volume_prototype: volume_prototype_model + ).result + volume_id = volume["id"] + + puts "list_snapshots() result:" + # begin-list_snapshots + + snapshot_collection = service.list_snapshots( + sort: "name" + ).result + + puts JSON.pretty_generate(snapshot_collection) + + # end-list_snapshots + + puts "create_snapshot() result:" + # begin-create_snapshot + + volume_identity_model = { + 'id': volume_id + } + clones = { + 'zone_name': "us-east-1" + } + + snapshot_prototype_model = { + 'clones': [clones], + 'source_volume': volume_identity_model, + 'name': "my-snapshot" + } + + snapshot = service.create_snapshot( + snapshot_prototype: snapshot_prototype_model + ).result + + puts JSON.pretty_generate(snapshot) + + # end-create_snapshot + snapshot_id = snapshot["id"] + snapshot_prototype_model_1 = { + 'source_volume': volume_identity_model, + 'name': "my-snapshot1" + } + service.create_snapshot( + snapshot_prototype: snapshot_prototype_model_1 + ) + + puts "get_snapshot() result:" + # begin-get_snapshot + + snapshot = service.get_snapshot(id: snapshot_id).result + + puts JSON.pretty_generate(snapshot) + + # end-get_snapshot + + puts "update_snapshot() result:" + # begin-update_snapshot + + snapshot_patch_model = { name: "updated-my-snapshot" } + + snapshot = service.update_snapshot( + id: snapshot_id, + snapshot_patch: snapshot_patch_model + ).result + + puts JSON.pretty_generate(snapshot) + + # end-update_snapshot + + puts "list_snapshot_clones() result:" + + # begin-list_snapshot_clones + + response = service.list_snapshot_clones( + id: snapshot_id + ) + snapshot_clone_collection = response.result + + puts JSON.pretty_generate(snapshot_clone_collection) + + # end-list_snapshot_clones + + print('\nget_snapshot_clone() result:') + + # begin-get_snapshot_clone + + response = service.get_snapshot_clone( + id: snapshot_id, + zone_name: "us-east-1" + ) + snapshot_clone = response.result + + puts JSON.pretty_generate(snapshot_clone) + + # end-get_snapshot_clone + + puts "create_snapshot_clone() result:" + + # begin-create_snapshot_clone + + response = service.create_snapshot_clone( + id: snapshot_id, + zone_name: "us-east-1" + ) + snapshot_clone = response.result + + puts JSON.pretty_generate(snapshot_clone) + + # end-create_snapshot_clone + + # begin-delete_snapshot_clone + + service.delete_snapshot_clone( + id: snapshot_id, + zone_name: "us-east-1" + ) + + # end-delete_snapshot_clone + + puts "delete_snapshot() result:" + # begin-delete_snapshot + + service.delete_snapshot(id: snapshot_id) + + # end-delete_snapshot + puts "delete_snapshots() result:" + # begin-delete_snapshots + + service.delete_snapshots( + source_volume_id: volume_id + ) + + # end-delete_snapshots + end + + def test_regions_example + puts "list_regions() result:" + # begin-list_regions + + region_collection = service.list_regions.result + + puts JSON.pretty_generate(region_collection) + + # end-list_regions + region_name = region_collection["regions"][2]["name"] + + puts "get_region() result:" + # begin-get_region + + region = service.get_region(name: region_name).result + + puts JSON.pretty_generate(region) + + # end-get_region + + puts "list_region_zones() result:" + # begin-list_region_zones + + zone_collection = service.list_region_zones( + region_name: region_name + ).result + + puts JSON.pretty_generate(zone_collection) + + # end-list_region_zones + zone_name = zone_collection["zones"][0]["name"] + + puts "get_region_zone() result:" + # begin-get_region_zone + + zone = service.get_region_zone(region_name: region_name, + name: zone_name).result + + puts JSON.pretty_generate(zone) + + # end-get_region_zone + end + + def test_public_gateway_example + vpc = service.create_vpc(name: "my-vpc-public-gateway").result + vpc_id = vpc["id"] + puts "list_public_gateways() result:" + # begin-list_public_gateways + + public_gateway_collection = service.list_public_gateways + .result + + puts JSON.pretty_generate(public_gateway_collection) + + # end-list_public_gateways + + puts "create_public_gateway() result:" + # begin-create_public_gateway + + vpc_identity_model = { + 'id': vpc_id + } + + zone_identity_model = { + 'name': "us-east-1" + } + + public_gateway = service.create_public_gateway( + vpc: vpc_identity_model, zone: zone_identity_model, + name: "my-public-gateway" + ).result + + puts JSON.pretty_generate(public_gateway) + + # end-create_public_gateway + public_gateway_id = public_gateway["id"] + + puts "get_public_gateway() result:" + # begin-get_public_gateway + + public_gateway = service.get_public_gateway( + id: public_gateway_id + ).result + + puts JSON.pretty_generate(public_gateway) + + # end-get_public_gateway + + puts "update_public_gateway() result:" + # begin-update_public_gateway + + public_gateway_patch_model = { name: "updated-my-public-gateway" } + + public_gateway = service.update_public_gateway( + id: public_gateway_id, + public_gateway_patch: public_gateway_patch_model + ).result + + puts JSON.pretty_generate(public_gateway) + + # end-update_public_gateway + + puts "delete_public_gateway() result:" + # begin-delete_public_gateway + + service.delete_public_gateway(id: public_gateway_id) + + # end-delete_public_gateway + + service.delete_vpc(id: vpc_id) + end + + def test_floating_ip_example + puts "list_floating_ips() result:" + # begin-list_floating_ips + + floating_ip_collection = service.list_floating_ips.result + + puts JSON.pretty_generate(floating_ip_collection) + + # end-list_floating_ips + + puts "create_floating_ip() result:" + # begin-create_floating_ip + + zone_identity_model = { + 'name': "us-east-1" + } + + floating_ip_prototype_model = { + 'zone': zone_identity_model, + 'name': "my-floating-ip" + } + + floating_ip = service.create_floating_ip( + floating_ip_prototype: floating_ip_prototype_model + ).result + + puts JSON.pretty_generate(floating_ip) + + # end-create_floating_ip + floating_ip_id = floating_ip["id"] + + puts "get_floating_ip() result:" + # begin-get_floating_ip + + floating_ip = service.get_floating_ip( + id: floating_ip_id + ).result + + puts JSON.pretty_generate(floating_ip) + + # end-get_floating_ip + + puts "Update_floating_ip() result:" + # begin-update_floating_ip + + floating_ip_patch_model = { name: "updatd-my-floating-ip" } + + floating_ip = service.update_floating_ip( + id: floating_ip_id, + floating_ip_patch: floating_ip_patch_model + ).result + + puts JSON.pretty_generate(floating_ip) + + # end-update_floating_ip + + # begin-delete_floating_ip + + service.delete_floating_ip(id: floating_ip_id) + + # end-delete_floating_ip + end + + def test_network_acl_example + vpc = service.create_vpc(name: "my-vpc-network-acl").result + vpc_id = vpc["id"] + puts "list_network_acls() result:" + # begin-list_network_acls + + network_acl_collection = service.list_network_acls.result + + puts JSON.pretty_generate(network_acl_collection) + + # end-list_network_acls + + puts "create_network_acl() result:" + # begin-create_network_acl + + vpc_identity_model = { + 'id': vpc_id + } + + network_acl_prototype_model = { + 'name': "my-network-acl", + 'vpc': vpc_identity_model + } + + network_acl = service.create_network_acl( + network_acl_prototype: network_acl_prototype_model + ).result + + puts JSON.pretty_generate(network_acl) + + # end-create_network_acl + network_acl_id = network_acl["id"] + + puts "get_network_acl() result:" + # begin-get_network_acl + + network_acl = service.get_network_acl( + id: network_acl_id + ).result + + puts JSON.pretty_generate(network_acl) + + # end-get_network_acl + + puts "update_network_acl() result:" + # begin-update_network_acl + + network_acl_patch_model = { name: "updated-my-network-acl" } + + network_acl = service.update_network_acl( + id: network_acl_id, + network_acl_patch: network_acl_patch_model + ).result + + puts JSON.pretty_generate(network_acl) + + # end-update_network_acl + + puts "list_network_acl_rules() result:" + # begin-list_network_acl_rules + + network_acl_rule_collection = service.list_network_acl_rules( + network_acl_id: network_acl_id + ).result + + puts JSON.pretty_generate(network_acl_rule_collection) + + # end-list_network_acl_rules + + puts "create_network_acl_rule() result:" + # begin-create_network_acl_rule + + network_acl_rule_prototype_model = { + 'action': "allow", + 'destination': "192.168.3.2/32", + 'direction': "inbound", + 'source': "192.168.3.2/32", + 'protocol': "icmp", + 'name': "my-network-acl-rule" + } + + network_acl_rule = service.create_network_acl_rule( + network_acl_id: network_acl_id, + network_acl_rule_prototype: network_acl_rule_prototype_model + ).result + + puts JSON.pretty_generate(network_acl_rule) + + # end-create_network_acl_rule + network_acl_rule_id = network_acl_rule["id"] + + puts "get_network_acl_rule() result:" + # begin-get_network_acl_rule + + network_acl_rule = service.get_network_acl_rule( + network_acl_id: network_acl_id, id: network_acl_rule_id + ).result + + puts JSON.pretty_generate(network_acl_rule) + + # end-get_network_acl_rule + + puts "update_network_acl_rule() result:" + # begin-update_network_acl_rule + + network_acl_rule_patch_model = { name: "updated-my-network-acl-rule" } + + network_acl_rule = service.update_network_acl_rule( + network_acl_id: network_acl_id, + id: network_acl_rule_id, + network_acl_rule_patch: network_acl_rule_patch_model + ).result + + puts JSON.pretty_generate(network_acl_rule) + + # end-update_network_acl_rule + + # begin-delete_network_acl_rule + + service.delete_network_acl_rule( + network_acl_id: network_acl_id, id: network_acl_rule_id + ) + + # end-delete_network_acl_rule + + # begin-delete_network_acl + + service.delete_network_acl(id: network_acl_id) + + # end-delete_network_acl + end + + def test_security_group_example + vpc = service.create_vpc(name: "my-vpc-security-group").result + vpc_id = vpc["id"] + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-security-group" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + subnet_id = subnet["id"] + + images = service.list_images.result["images"] + image_id = images[5]["id"] + + key = service.create_key( + name: "my-key", + public_key: + "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En" + ).result + key_id = key["id"] + + instance_profile_identity_model = { + 'name': "bx2d-8x32" + } + key_identity_model = { + 'id': key_id + } + + vpc_identity_model = { + 'id': vpc_id + } + + volume_attachment_prototype_instance_by_image_context_model = { + 'volume': { + 'name': "my-boot-volume", + 'profile': { + 'name': "general-purpose" + } + } + } + + image_identity_model = { + 'id': image_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface_prototype_model = { + 'name': "my-network-interface", + 'subnet': subnet_identity_model + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_attachment_prototype_model = { + 'delete_volume_on_instance_delete': true, + 'volume': { + 'capacity': 1000, + 'name': "my-data-volume", + 'profile': { + 'name': "5iops-tier" + } + } + } + + instance_prototype_model = { + 'keys': [key_identity_model], + 'name': "my-security-group-instanc", + + 'profile': instance_profile_identity_model, + 'volume_attachments': [volume_attachment_prototype_model], + 'vpc': vpc_identity_model, + 'boot_volume_attachment': volume_attachment_prototype_instance_by_image_context_model, + 'image': image_identity_model, + 'primary_network_interface': network_interface_prototype_model, + 'zone': zone_identity_model + } + + instance = service.create_instance( + instance_prototype: instance_prototype_model + ).result + + network_interface_id = instance["primary_network_interface"]["id"] + puts network_interface_id + + puts "list_security_groups() result:" + # begin-list_security_groups + + security_group_collection = service.list_security_groups + .result + + puts JSON.pretty_generate(security_group_collection) + + # end-list_security_groups + + puts "create_security_group() result:" + # begin-create_security_group + + vpc_identity_model = { + 'id': vpc_id + } + + security_group = service.create_security_group(vpc: vpc_identity_model, + name: "my-security-group").result + + puts JSON.pretty_generate(security_group) + + # end-create_security_group + security_group_id = security_group["id"] + + puts "get_security_group() result:" + # begin-get_security_group + + security_group = service.get_security_group( + id: security_group_id + ).result + + puts JSON.pretty_generate(security_group) + + # end-get_security_group + + puts "update_security_group() result:" + # begin-update_security_group + + security_group_patch_model = { name: "updated-my-security-group" } + + security_group = service.update_security_group( + id: security_group_id, + security_group_patch: security_group_patch_model + ).result + + puts JSON.pretty_generate(security_group) + + # end-update_security_group + + puts "list_security_group_rules() result:" + # begin-list_security_group_rules + + security_group_rule_collection = service.list_security_group_rules( + security_group_id: security_group_id + ).result + + puts JSON.pretty_generate(security_group_rule_collection) + + # end-list_security_group_rules + + puts "create_security_group_rule() result:" + # begin-create_security_group_rule + + security_group_rule_prototype_model = { + 'direction': "inbound", + 'protocol': "icmp", + 'name': "my-security-group-rule" + } + + security_group_rule = service.create_security_group_rule( + security_group_id: security_group_id, + security_group_rule_prototype: security_group_rule_prototype_model + ).result + + puts JSON.pretty_generate(security_group_rule) + + # end-create_security_group_rule + security_group_rule_id = security_group_rule["id"] + + puts "get_security_group_rule() result:" + # begin-get_security_group_rule + + security_group_rule = service.get_security_group_rule( + security_group_id: security_group_id, id: security_group_rule_id + ).result + + puts JSON.pretty_generate(security_group_rule) + + # end-get_security_group_rule + + puts "update_security_group_rule() result:" + # begin-update_security_group_rule + + security_group_rule_patch_model = { name: "updated-my-security-group-rule" } + + security_group_rule = service.update_security_group_rule( + security_group_id: security_group_id, + id: security_group_rule_id, + security_group_rule_patch: security_group_rule_patch_model + ).result + + puts JSON.pretty_generate(security_group_rule) + + # end-update_security_group_rule + + puts "list_security_group_targets() result:" + # begin-list_security_group_targets + + security_group_target_collection = service.list_security_group_targets( + security_group_id: security_group_id + ).result + puts security_group_target_collection + puts JSON.pretty_generate(security_group_target_collection) + + # end-list_security_group_targets + + puts "create_security_group_target_binding() result:" + # begin-create_security_group_target_binding + + security_group_target_reference = service.create_security_group_target_binding( + security_group_id: security_group_id, id: network_interface_id + ).result + puts security_group_target_reference + puts JSON.pretty_generate(security_group_target_reference) + + # end-create_security_group_target_binding + + puts "get_security_group_target() result:" + # begin-get_security_group_target + + security_group_target_reference = service.get_security_group_target( + security_group_id: security_group_id, id: network_interface_id + ).result + + puts security_group_target_reference + puts JSON.pretty_generate(security_group_target_reference) + + # end-get_security_group_target + + puts "delete_security_group_target_binding() result:" + # begin-delete_security_group_target_binding + + service.delete_security_group_target_binding( + security_group_id: security_group_id, id: network_interface_id + ) + + # end-delete_security_group_target_binding + + puts "delete_security_group_rule() result:" + # begin-delete_security_group_rule + + service.delete_security_group_rule( + security_group_id: security_group_id, id: security_group_rule_id + ) + + # end-delete_security_group_rule + + puts "delete_security_group() result:" + # begin-delete_security_group + + service.delete_security_group(id: security_group_id) + + # end-delete_security_group + + service.delete_key(id: key_id) + end + + def test_vpn_gateways_example + vpc = service.create_vpc(name: "my-vpc-vpn-gateway").result + vpc_id = vpc["id"] + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-vpn-gateway" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + subnet_id = subnet["id"] + + puts "list_ike_policies() result:" + # begin-list_ike_policies + + ike_policy_collection = service.list_ike_policies.result + + puts JSON.pretty_generate(ike_policy_collection) + + # end-list_ike_policies + + puts "create_ike_policy() result:" + # begin-create_ike_policy + + ike_policy = service.create_ike_policy( + authentication_algorithm: "sha256", + dh_group: 14, + encryption_algorithm: "aes192", + ike_version: 1, + name: "my-ike-policy" + ).result + + puts JSON.pretty_generate(ike_policy) + + # end-create_ike_policy + ike_id = ike_policy["id"] + + puts "get_ike_policy() result:" + # begin-get_ike_policy + + ike_policy = service.get_ike_policy( + id: ike_id + ).result + + puts JSON.pretty_generate(ike_policy) + + # end-get_ike_policy + + puts "update_ike_policy() result:" + # begin-update_ike_policy + + ike_policy_patch_model = { name: "updated-my-ike-policy" } + + ike_policy = service.update_ike_policy( + id: ike_id, + ike_policy_patch: ike_policy_patch_model + ).result + + puts JSON.pretty_generate(ike_policy) + + # end-update_ike_policy + + puts "list_ike_policy_connections() result:" + # begin-list_ike_policy_connections + + vpn_gateway_connection_collection = service.list_ike_policy_connections( + id: ike_id + ).result + + puts JSON.pretty_generate(vpn_gateway_connection_collection) + + # end-list_ike_policy_connections + + puts "list_ipsec_policies() result:" + # begin-list_ipsec_policies + + i_psec_policy_collection = service.list_ipsec_policies + .result + + puts JSON.pretty_generate(i_psec_policy_collection) + + # end-list_ipsec_policies + + puts "create_ipsec_policy() result:" + # begin-create_ipsec_policy + + i_psec_policy = service.create_ipsec_policy( + authentication_algorithm: "sha256", + encryption_algorithm: "aes192", + pfs: "disabled", + name: "updated-my-ipsec-policy" + ).result + + puts JSON.pretty_generate(i_psec_policy) + + # end-create_ipsec_policy + i_psec_policy_id = i_psec_policy["id"] + + puts "get_ipsec_policy() result:" + # begin-get_ipsec_policy + + i_psec_policy = service.get_ipsec_policy( + id: i_psec_policy_id + ).result + + puts JSON.pretty_generate(i_psec_policy) + + # end-get_ipsec_policy + + puts "update_ipsec_policy() result:" + # begin-update_ipsec_policy + + i_psec_policy_patch_model = { name: "updated-my-ipsec-policy" } + + i_psec_policy = service.update_ipsec_policy( + id: i_psec_policy_id, + i_psec_policy_patch: i_psec_policy_patch_model + ).result + + puts JSON.pretty_generate(i_psec_policy) + + # end-update_ipsec_policy + + puts "list_ipsec_policy_connections() result:" + # begin-list_ipsec_policy_connections + + ipsec_policy_connection_collection = service.list_ipsec_policy_connections( + id: i_psec_policy_id + ).result + + puts JSON.pretty_generate(ipsec_policy_connection_collection) + + # end-list_ipsec_policy_connections + + puts "list_vpn_gateways() result:" + # begin-list_vpn_gateways + + vpn_gateway_collection = service.list_vpn_gateways( + mode: "route" + ).result + + puts JSON.pretty_generate(vpn_gateway_collection) + + # end-list_vpn_gateways + + puts "create_vpn_gateway() result:" + # begin-create_vpn_gateway + + subnet_identity_model = { + 'id': subnet_id + } + + vpn_gateway_prototype_model = { + 'subnet': subnet_identity_model, + 'name': "my-vpn-gateway" + } + + vpn_gateway = service.create_vpn_gateway( + vpn_gateway_prototype: vpn_gateway_prototype_model + ).result + + puts JSON.pretty_generate(vpn_gateway) + + # end-create_vpn_gateway + vpn_gateway_id = vpn_gateway["id"] + + puts "get_vpn_gateway() result:" + # begin-get_vpn_gateway + + vpn_gateway = service.get_vpn_gateway( + id: vpn_gateway_id + ).result + + puts JSON.pretty_generate(vpn_gateway) + + # end-get_vpn_gateway + + puts "update_vpn_gateway() result:" + # begin-update_vpn_gateway + + vpn_gateway_patch_model = { name: "updated-my-vpn-gateway" } + + vpn_gateway = service.update_vpn_gateway( + id: vpn_gateway_id, + vpn_gateway_patch: vpn_gateway_patch_model + ).result + + puts JSON.pretty_generate(vpn_gateway) + + # end-update_vpn_gateway + + puts "list_vpn_gateway_connections() result:" + # begin-list_vpn_gateway_connections + + vpn_gateway_connection_collection = service.list_vpn_gateway_connections( + vpn_gateway_id: vpn_gateway_id + ).result + + puts JSON.pretty_generate(vpn_gateway_connection_collection) + + # end-list_vpn_gateway_connections + + puts "create_vpn_gateway_connection() result:" + # begin-create_vpn_gateway_connection + + vpn_gateway_connection_prototype_model = { + 'peer_address': "169.21.50.5", + 'psk': "lkj14b1oi0alcniejkso", + 'name': "my-vpn-gateway-connection" + } + + vpn_gateway_connection = service.create_vpn_gateway_connection( + vpn_gateway_id: vpn_gateway_id, + vpn_gateway_connection_prototype: + vpn_gateway_connection_prototype_model + ).result + + puts JSON.pretty_generate(vpn_gateway_connection) + + # end-create_vpn_gateway_connection + + vpn_gateway_connection_id = vpn_gateway_connection["id"] + + puts "get_vpn_gateway_connection() result:" + # begin-get_vpn_gateway_connection + + vpn_gateway_connection = service.get_vpn_gateway_connection( + vpn_gateway_id: vpn_gateway_id, id: vpn_gateway_connection_id + ).result + + puts JSON.pretty_generate(vpn_gateway_connection) + + # end-get_vpn_gateway_connection + + puts "update_vpn_gateway_connection() result:" + # begin-update_vpn_gateway_connection + + vpn_gateway_connection_patch_model = { name: "updated-my-vpn-gateway-connection" } + + vpn_gateway_connection = service.update_vpn_gateway_connection( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + vpn_gateway_connection_patch: vpn_gateway_connection_patch_model + ).result + + puts JSON.pretty_generate(vpn_gateway_connection) + + # end-update_vpn_gateway_connection + + puts "list_vpn_gateway_connection_local_cidrs() result:" + # begin-list_vpn_gateway_connection_local_cidrs + + vpn_gateway_connection_local_cid_rs = service.list_vpn_gateway_connection_local_cidrs( + vpn_gateway_id: vpn_gateway_id, id: vpn_gateway_connection_id + ).result + + puts JSON.pretty_generate(vpn_gateway_connection_local_cid_rs) + + # end-list_vpn_gateway_connection_local_cidrs + + # begin-add_vpn_gateway_connection_local_cidr + + service.add_vpn_gateway_connection_local_cidr( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + cidr_prefix: "192.168.0.15/24", + prefix_length: 4 + ) + + # end-add_vpn_gateway_connection_local_cidr + + # begin-check_vpn_gateway_connection_local_cidr + + service.check_vpn_gateway_connection_local_cidr( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + cidr_prefix: "192.168.0.15/24", + prefix_length: 4 + ) + + # end-check_vpn_gateway_connection_local_cidr + + puts "list_vpn_gateway_connection_peer_cidrs() result:" + # begin-list_vpn_gateway_connection_peer_cidrs + + vpn_gateway_connection_peer_cid_rs = service.list_vpn_gateway_connection_peer_cidrs( + vpn_gateway_id: vpn_gateway_id, id: vpn_gateway_connection_id + ).result + + puts JSON.pretty_generate(vpn_gateway_connection_peer_cid_rs) + + # end-list_vpn_gateway_connection_peer_cidrs + + # begin-add_vpn_gateway_connection_peer_cidr + + service.add_vpn_gateway_connection_peer_cidr( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + cidr_prefix: "192.168.0.15/24", + prefix_length: 4 + ) + + # end-add_vpn_gateway_connection_peer_cidr + + # begin-check_vpn_gateway_connection_peer_cidr + + service.check_vpn_gateway_connection_peer_cidr( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + cidr_prefix: "192.168.0.15/24", + prefix_length: 4 + ) + + # end-check_vpn_gateway_connection_peer_cidr + + # begin-delete_ike_policy + + service.delete_ike_policy( + id: ike_id + ) + + # end-delete_ike_policy + + # begin-remove_vpn_gateway_connection_peer_cidr + + service.remove_vpn_gateway_connection_peer_cidr( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + cidr_prefix: "192.168.0.15/24", + prefix_length: 4 + ) + + # end-remove_vpn_gateway_connection_peer_cidr + + # begin-remove_vpn_gateway_connection_local_cidr + + service.remove_vpn_gateway_connection_local_cidr( + vpn_gateway_id: vpn_gateway_id, + id: vpn_gateway_connection_id, + cidr_prefix: "192.168.0.15/24", + prefix_length: 4 + ) + + # end-remove_vpn_gateway_connection_local_cidr + + # begin-delete_vpn_gateway_connection + + service.delete_vpn_gateway_connection( + vpn_gateway_id: vpn_gateway_id, id: vpn_gateway_connection_id + ) + + # end-delete_vpn_gateway_connection + + # begin-delete_vpn_gateway + + service.delete_vpn_gateway(id: vpn_gateway_id) + + # end-delete_vpn_gateway + + service.delete_subnet(id: subnet_id) + + service.delete_vpc(id: vpc_id) + end + + def test_back_up_policies + puts "list_backup_policies() result:" + # begin-list_backup_policies + + backup_policy_collection = service.list_backup_policies.result + puts backup_policy_collection + puts JSON.pretty_generate(backup_policy_collection) + + # end-list_backup_policies + + volume_profile_identity_model = { + 'name': "5iops-tier" + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_prototype_model = { + 'profile': volume_profile_identity_model, + 'zone': zone_identity_model, + 'capacity': 100, + 'name': "my-volume-backup-policy", + 'user_tags': ["my-daily-backup-policy"] + } + + service.create_volume( + volume_prototype: volume_prototype_model + ).result + + puts "create_backup_policy() result:" + # begin-create_backup_policy + backup_policy_plan_deletion_trigger_prototype_model = { + 'delete_after': 20, + 'delete_over_count': 20 + } + + backup_policy_plan_prototype_model = { + 'active': true, + 'attach_user_tags': ["my-daily-backup-plan"], + 'copy_user_tags': true, + 'cron_spec': "*/5 1,2,3 * * *", + 'deletion_trigger': backup_policy_plan_deletion_trigger_prototype_model, + 'name': "my-backup-policy-plan" + } + + backup_policy_response = service.create_backup_policy( + match_user_tags: ["my-daily-backup-policy"], + match_resource_types: ["volume"], + name: "my-backup-policy", + plans: [backup_policy_plan_prototype_model] + ) + backup_policy = backup_policy_response.result + backup_policy_etag = backup_policy_response.headers["ETag"] + puts backup_policy + puts JSON.pretty_generate(backup_policy) + + # end-create_backup_policy + backup_policy_id = backup_policy["id"] + + puts "list_backup_policy_plans() result:" + # begin-list_backup_policy_plans + + backup_policy_plan_collection = service.list_backup_policy_plans( + backup_policy_id: backup_policy_id + ).result + puts backup_policy_plan_collection + puts JSON.pretty_generate(backup_policy_plan_collection) + + # end-list_backup_policy_plans + + puts "create_backup_policy_plan() result:" + # begin-create_backup_policy_plan + + backup_policy_plan_deletion_trigger_prototype_model = { + 'delete_after': 20, + 'delete_over_count': 20 + } + zone_identity_model = { + 'name': "us-east-1" + } + backup_policy_plan_clone_policy_prototype_model = { + 'max_snapshots': 38, + 'zones': [zone_identity_model] + } + backup_policy_plan_response = service.create_backup_policy_plan( + backup_policy_id: backup_policy_id, + cron_spec: "*/5 1,2,3 * * *", + active: true, + attach_user_tags: ["my-daily-backup-plan"], + copy_user_tags: true, + clone_policy: backup_policy_plan_clone_policy_prototype_model, + deletion_trigger: backup_policy_plan_deletion_trigger_prototype_model, + name: "my-backup-policy-plan" + ) + backup_policy_plan = backup_policy_plan_response.result + backup_policy_plan_etag = backup_policy_plan_response.headers["ETag"] + puts backup_policy_plan + puts JSON.pretty_generate(backup_policy_plan) + + # end-create_backup_policy_plan + backup_policy_plan_id = backup_policy_plan["id"] + + puts "get_backup_policy_plan() result:" + # begin-get_backup_policy_plan + + backup_policy_plan = service.get_backup_policy_plan( + backup_policy_id: backup_policy_id, + id: backup_policy_plan_id + ).result + puts backup_policy_plan + puts JSON.pretty_generate(backup_policy_plan) + + # end-get_backup_policy_plan + + puts "update_backup_policy_plan() result:" + # begin-update_backup_policy_plan + + backup_policy_plan_patch_model = {} + backup_policy_plan_patch_model["name"] = "my-backup-policy-plan-updated" + + backup_policy_plan = service.update_backup_policy_plan( + backup_policy_id: backup_policy_id, + id: backup_policy_plan_id, + backup_policy_plan_patch: backup_policy_plan_patch_model, + if_match: backup_policy_plan_etag + ).result + puts backup_policy_plan + puts JSON.pretty_generate(backup_policy_plan) + + # end-update_backup_policy_plan + + puts "list_backup_policy_jobs() result:" + # begin-list_backup_policy_jobs + + backup_policy_jobs = service.list_backup_policy_jobs(backup_policy_id: backup_policy_id, backup_policy_plan_id: backup_policy_plan_id).result + + # end-list_backup_policy_jobs + puts JSON.pretty_generate(backup_policy_jobs) + backup_policy_job_id = backup_policy_jobs["jobs"][0]["id"] + + print('\nget_backup_policy_job() result:') + # begin-get_backup_policy_job + + response = service.get_backup_policy_job( + backup_policy_id: backup_policy_id, + id: backup_policy_job_id + ) + backup_policy_job = response.result + + # end-get_backup_policy_job + assert !backup_policy_job.nil? + + puts "get_backup_policy() result:" + # begin-get_backup_policy + + backup_policy = service.get_backup_policy( + id: backup_policy_id + ).result + puts backup_policy + puts JSON.pretty_generate(backup_policy) + + # end-get_backup_policy + + puts "update_backup_policy() result:" + # begin-update_backup_policy + + backup_policy_patch_model = {} + backup_policy_patch_model["name"] = "my-backup-policy-updated" + + backup_policy = service.update_backup_policy( + id: backup_policy_id, + backup_policy_patch: backup_policy_patch_model, + if_match: backup_policy_etag + ).result + puts backup_policy + puts JSON.pretty_generate(backup_policy) + + # end-update_backup_policy + + puts "delete_backup_policy_plan() result:" + # begin-delete_backup_policy_plan + + backup_policy_plan = service.delete_backup_policy_plan( + backup_policy_id: backup_policy_id, + id: backup_policy_plan_id, + if_match: backup_policy_plan_etag + ).result + puts backup_policy_plan + puts JSON.pretty_generate(backup_policy_plan) + + # end-delete_backup_policy_plan + + puts "delete_backup_policy() result:" + # begin-delete_backup_policy + + backup_policy = service.delete_backup_policy( + id: backup_policy_id, + if_match: backup_policy_etag + ).result + puts backup_policy + puts JSON.pretty_generate(backup_policy) + + # end-delete_backup_policy + end + + def test_vpn_servers + vpc = service.create_vpc(name: "my-vpc-vpn-server").result + vpc_id = vpc["id"] + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-vpn-server" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + subnet_id = subnet["id"] + puts "list_vpn_servers() result:" + # begin-list_vpn_servers + + vpn_server_collection = service.list_vpn_servers( + sort: "name" + ).result + + puts JSON.pretty_generate(vpn_server_collection) + + # end-list_vpn_servers + + puts "create_vpn_server() result:" + # begin-create_vpn_server + + certificate_instance_identity_model = { + 'crn': "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5" + } + + vpn_server_authentication_by_username_id_provider_model = { + 'provider_type': "iam" + } + + vpn_server_authentication_prototype_model = { + 'method': "certificate", + 'identity_provider': vpn_server_authentication_by_username_id_provider_model + } + + subnet_identity_model = { + 'id': subnet_id + } + + vpn_server = service.create_vpn_server( + certificate: certificate_instance_identity_model, + client_authentication: [vpn_server_authentication_prototype_model], + client_ip_pool: "172.16.0.0/16", + subnets: [subnet_identity_model], + name: "my-example-vpn-server" + ).result + + puts vpn_server + puts JSON.pretty_generate(vpn_server) + + # end-create_vpn_server + + vpn_server_id = vpn_server["id"] + + puts "get_vpn_server() result:" + # begin-get_vpn_server + + vpn_server_response = service.get_vpn_server( + id: vpn_server_id + ) + created_vpn_server_etag = vpn_server_response.headers["ETag"] + vpn_server = vpn_server_response.result + + puts vpn_server + puts JSON.pretty_generate(vpn_server) + + # end-get_vpn_server + + puts "update_vpn_server() result:" + # begin-update_vpn_server + + vpn_server_patch_model = {} + vpn_server_patch_model["name"] = "my-vpn-server-updated" + + vpn_server = service.update_vpn_server( + id: vpn_server_id, + vpn_server_patch: vpn_server_patch_model, + if_match: created_vpn_server_etag + ).result + puts vpn_server + puts JSON.pretty_generate(vpn_server) + + # end-update_vpn_server + + puts "get_vpn_server_client_configuration() result:" + # begin-get_vpn_server_client_configuration + + vpn_server_client_configuration = service.get_vpn_server_client_configuration( + id: vpn_server_id + ).result + puts vpn_server_client_configuration + puts JSON.pretty_generate(vpn_server_client_configuration) + + # end-get_vpn_server_client_configuration + + puts "list_vpn_server_clients() result:" + # begin-list_vpn_server_clients + + vpn_server_client_collection = service.list_vpn_server_clients( + vpn_server_id: vpn_server_id, + sort: "created_at" + ).result + puts vpn_server_client_collection + puts JSON.pretty_generate(vpn_server_client_collection) + + # end-list_vpn_server_clients + vpn_server_client_id = vpn_server_client_collection["clients"][0]["id"] + + puts "get_vpn_server_client() result:" + # begin-get_vpn_server_client + + vpn_server_client = service.get_vpn_server_client( + vpn_server_id: vpn_server_id, + id: vpn_server_client_id + ).result + puts vpn_server_client + puts JSON.pretty_generate(vpn_server_client) + + # end-get_vpn_server_client + + # begin-disconnect_vpn_client + + service.disconnect_vpn_client( + vpn_server_id: vpn_server_id, + id: vpn_server_client_id + ) + + # end-disconnect_vpn_client + + puts "list_vpn_server_routes() result:" + # begin-list_vpn_server_routes + + vpn_server_route_collection = service.list_vpn_server_routes( + vpn_server_id: vpn_server_id, + sort: "name" + ).result + puts vpn_server_route_collection + puts JSON.pretty_generate(vpn_server_route_collection) + + # end-list_vpn_server_routes + + puts "create_vpn_server_route() result:" + # begin-create_vpn_server_route + + vpn_server_route = service.create_vpn_server_route( + vpn_server_id: vpn_server_id, + destination: "172.16.0.0/16", + name: "my-vpn-server-route" + ).result + puts vpn_server_route + puts JSON.pretty_generate(vpn_server_route) + + # end-create_vpn_server_route + vpn_server_route_id = vpn_server_route["id"] + + puts "get_vpn_server_route() result:" + # begin-get_vpn_server_route + + vpn_server_route = service.get_vpn_server_route( + vpn_server_id: vpn_server_id, + id: vpn_server_route_id + ).result + puts vpn_server_route + puts JSON.pretty_generate(vpn_server_route) + + # end-get_vpn_server_route + + puts "update_vpn_server_route() result:" + # begin-update_vpn_server_route + + vpn_server_route_patch_model = {} + vpn_server_route_patch_model["name"] = "my-vpnserver-route-updated" + + vpn_server_route = service.update_vpn_server_route( + vpn_server_id: vpn_server_id, + id: vpn_server_route_id, + vpn_server_route_patch: vpn_server_route_patch_model + ).result + puts vpn_server_route + puts JSON.pretty_generate(vpn_server_route) + # end-update_vpn_server_route + + # begin-delete_vpn_server_route + + service.delete_vpn_server_route( + vpn_server_id: vpn_server_id, + id: vpn_server_route_id + ) + + # end-delete_vpn_server_route + + # begin-delete_vpn_server_client + + response = service.delete_vpn_server_client( + vpn_server_id: vpn_server_id, + id: vpn_server_client_id + ) + puts "delete_vpn_server_client response" + puts response + # end-delete_vpn_server_client + + # begin-delete_vpn_server + + service.delete_vpn_server( + id: vpn_server_id, + if_match: created_vpn_server_etag + ) + + # end-delete_vpn_server + end + + def test_load_balancer_example + vpc = service.create_vpc(name: "my-vpc-load-balancer").result + vpc_id = vpc["id"] + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-load-balancer" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + subnet_id = subnet["id"] + + images = service.list_images.result["images"] + image_id = images[5]["id"] + + key = service.create_key( + name: "my-key-load-balancer", + public_key: + "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En" + ).result + key_id = key["id"] + + instance_profile_identity_model = { + 'name': "bx2d-8x32" + } + key_identity_model = { + 'id': key_id + } + + vpc_identity_model = { + 'id': vpc_id + } + + volume_attachment_prototype_instance_by_image_context_model = { + 'volume': { + 'name': "my-boot-volume", + 'profile': { + 'name': "general-purpose" + } + } + } + + image_identity_model = { + 'id': image_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface_prototype_model = { + 'name': "my-network-interface", + 'subnet': subnet_identity_model + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_attachment_prototype_model = { + 'delete_volume_on_instance_delete': true, + 'volume': { + 'capacity': 1000, + 'name': "my-data-volume", + 'profile': { + 'name': "5iops-tier" + } + } + } + + instance_prototype_model = { + 'keys': [key_identity_model], + 'name': "my-instance-load-balancer", + + 'profile': instance_profile_identity_model, + 'volume_attachments': [volume_attachment_prototype_model], + 'vpc': vpc_identity_model, + 'boot_volume_attachment': volume_attachment_prototype_instance_by_image_context_model, + 'image': image_identity_model, + 'primary_network_interface': network_interface_prototype_model, + 'zone': zone_identity_model + } + + instance = service.create_instance( + instance_prototype: instance_prototype_model + ).result + instance_id = instance["id"] + + instance_profile_identity_model = { + 'name': "bx2d-8x32" + } + key_identity_model = { + 'id': key_id + } + + vpc_identity_model = { + 'id': vpc_id + } + + volume_attachment_prototype_instance_by_image_context_model = { + 'volume': { + 'name': "my-boot-volume", + 'profile': { + 'name': "general-purpose" + } + } + } + + image_identity_model = { + 'id': image_id + } + + subnet_identity_model = { + 'id': subnet_id + } + + network_interface_prototype_model = { + 'name': "my-network-interface", + 'subnet': subnet_identity_model + } + + zone_identity_model = { + 'name': "us-east-1" + } + + volume_attachment_prototype_model = { + 'delete_volume_on_instance_delete': true, + 'volume': { + 'capacity': 1000, + 'name': "my-data-volume", + 'profile': { + 'name': "5iops-tier" + } + } + } + + instance_prototype_model = { + 'keys': [key_identity_model], + 'name': "my-instance-load-balancer1", + + 'profile': instance_profile_identity_model, + 'volume_attachments': [volume_attachment_prototype_model], + 'vpc': vpc_identity_model, + 'boot_volume_attachment': volume_attachment_prototype_instance_by_image_context_model, + 'image': image_identity_model, + 'primary_network_interface': network_interface_prototype_model, + 'zone': zone_identity_model + } + + instance = service.create_instance( + instance_prototype: instance_prototype_model + ).result + instance_id_1 = instance["id"] + + puts "list_load_balancer_profiles() result:" + # begin-list_load_balancer_profiles + + load_balancer_profile_collection = service.list_load_balancer_profiles + .result + + puts JSON.pretty_generate(load_balancer_profile_collection) + + # end-list_load_balancer_profiles + + load_balancer_profile = load_balancer_profile_collection["profiles"][0]["name"] + puts "get_load_balancer_profile() result:" + + # begin-get_load_balancer_profile + + load_balancer_profile = service.get_load_balancer_profile( + name: load_balancer_profile + ).result + + puts JSON.pretty_generate(load_balancer_profile) + + # end-get_load_balancer_profile + + puts "list_load_balancers() result:" + # begin-list_load_balancers + + load_balancer_collection = service.list_load_balancers + .result + + puts JSON.pretty_generate(load_balancer_collection) + + # end-list_load_balancers + + puts "create_load_balancer() result:" + # begin-create_load_balancer + + subnet_identity_model = { + 'id': subnet_id + } + + load_balancer = service.create_load_balancer( + is_public: true, subnets: [subnet_identity_model], + name: "my-load-balancer" + ).result + + puts JSON.pretty_generate(load_balancer) + + # end-create_load_balancer + load_balancer_id = load_balancer["id"] + + puts "get_load_balancer() result:" + # begin-get_load_balancer + + load_balancer = service.get_load_balancer( + id: load_balancer_id + ).result + + puts JSON.pretty_generate(load_balancer) + + # end-get_load_balancer + + puts "update_load_balancer() result:" + # begin-update_load_balancer + + load_balancer_patch_model = { name: "updated-my-load-balancer" } + + load_balancer = service.update_load_balancer( + id: load_balancer_id, + load_balancer_patch: load_balancer_patch_model + ).result + + puts JSON.pretty_generate(load_balancer) + + # end-update_load_balancer + + puts "get_load_balancer_statistics() result:" + # begin-get_load_balancer_statistics + + load_balancer_statistics = service.get_load_balancer_statistics( + id: load_balancer_id + ).result + + puts JSON.pretty_generate(load_balancer_statistics) + + # end-get_load_balancer_statistics + + puts "list_load_balancer_listeners() result:" + # begin-list_load_balancer_listeners + + load_balancer_listener_collection = service.list_load_balancer_listeners( + load_balancer_id: load_balancer_id + ).result + + puts JSON.pretty_generate(load_balancer_listener_collection) + + # end-list_load_balancer_listeners + + puts "create_load_balancer_listener() result:" + # begin-create_load_balancer_listener + + load_balancer_listener = service.create_load_balancer_listener( + load_balancer_id: load_balancer_id, port: 443, + protocol: "http" + ).result + + puts JSON.pretty_generate(load_balancer_listener) + + # end-create_load_balancer_listener + load_balancer_listener_id = load_balancer_listener["id"] + + puts "get_load_balancer_listener() result:" + # begin-get_load_balancer_listener + + load_balancer_listener = service.get_load_balancer_listener( + load_balancer_id: load_balancer_id, id: load_balancer_listener_id + ).result + + puts JSON.pretty_generate(load_balancer_listener) + + # end-get_load_balancer_listener + + puts "update_load_balancer_listener() result:" + # begin-update_load_balancer_listener + + load_balancer_listener_patch_model = { name: "updated-my-load-balancer-listener" } + + load_balancer_listener = service.update_load_balancer_listener( + load_balancer_id: load_balancer_id, + id: load_balancer_listener_id, + load_balancer_listener_patch: load_balancer_listener_patch_model + ).result + + puts JSON.pretty_generate(load_balancer_listener) + + # end-update_load_balancer_listener + + puts "list_load_balancer_listener_policies() result:" + # begin-list_load_balancer_listener_policies + + load_balancer_listener_policy_collection = service.list_load_balancer_listener_policies( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy_collection) + + # end-list_load_balancer_listener_policies + + puts "create_load_balancer_listener_policy() result:" + # begin-create_load_balancer_listener_policy + + load_balancer_listener_policy = service.create_load_balancer_listener_policy( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + action: "forward", + priority: 5, + name: "my-load-balancer-listener-policy" + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy) + + # end-create_load_balancer_listener_policy + load_balancer_listener_policy_id = load_balancer_listener_policy["id"] + + puts "get_load_balancer_listener_policy() result:" + # begin-get_load_balancer_listener_policy + + load_balancer_listener_policy = service.get_load_balancer_listener_policy( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + id: load_balancer_listener_policy_id + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy) + + # end-get_load_balancer_listener_policy + + puts "list_load_balancer_listener_policy_rules() result:" + # begin-list_load_balancer_listener_policy_rules + + load_balancer_listener_policy_rule_collection = service.list_load_balancer_listener_policy_rules( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + policy_id: load_balancer_listener_policy_id + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy_rule_collection) + + # end-list_load_balancer_listener_policy_rules + + puts "create_load_balancer_listener_policy_rule() result:" + # begin-create_load_balancer_listener_policy_rule + + load_balancer_listener_policy_rule = service.create_load_balancer_listener_policy_rule( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + policy_id: load_balancer_listener_policy_id, + condition: "contains", + type: "header", + value: "2", + field: "1" + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy_rule) + + # end-create_load_balancer_listener_policy_rule + load_balancer_listener_policy_rule_id = load_balancer_listener_policy_rule["id"] + + puts "get_load_balancer_listener_policy_rule() result:" + # begin-get_load_balancer_listener_policy_rule + + load_balancer_listener_policy_rule = service.get_load_balancer_listener_policy_rule( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + policy_id: load_balancer_listener_policy_id, + id: load_balancer_listener_policy_rule_id + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy_rule) + + # end-get_load_balancer_listener_policy_rule + + puts "update_load_balancer_listener_policy_rule() result:" + # begin-update_load_balancer_listener_policy_rule + + load_balancer_listener_policy_rule_patch_model = { 'condition': "contains", + 'type': "header", + 'value': "2", 'field': "3" } + + load_balancer_listener_policy_rule = service.update_load_balancer_listener_policy_rule( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + policy_id: load_balancer_listener_policy_id, + id: load_balancer_listener_policy_rule_id, + load_balancer_listener_policy_rule_patch: + load_balancer_listener_policy_rule_patch_model + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy_rule) + + # end-update_load_balancer_listener_policy_rule + + puts "list_load_balancer_pools() result:" + # begin-list_load_balancer_pools + + load_balancer_pool_collection = service.list_load_balancer_pools( + load_balancer_id: load_balancer_id + ).result + + puts JSON.pretty_generate(load_balancer_pool_collection) + + # end-list_load_balancer_pools + + puts "create_load_balancer_pool() result:" + # begin-create_load_balancer_pool + + load_balancer_pool_health_monitor_prototype_model = { + 'delay': 5, + 'max_retries': 2, + 'timeout': 2, + 'type': "http" + } + + load_balancer_pool = service.create_load_balancer_pool( + load_balancer_id: load_balancer_id, + algorithm: "least_connections", + health_monitor: load_balancer_pool_health_monitor_prototype_model, + protocol: "http", + name: "my-load-balancer-pool" + ).result + + puts JSON.pretty_generate(load_balancer_pool) + + # end-create_load_balancer_pool + load_balancer_pool_id = load_balancer_pool["id"] + + puts "get_load_balancer_pool() result:" + # begin-get_load_balancer_pool + + load_balancer_pool = service.get_load_balancer_pool( + load_balancer_id: load_balancer_id, id: load_balancer_pool_id + ).result + + puts JSON.pretty_generate(load_balancer_pool) + + # end-get_load_balancer_pool + + puts "update_load_balancer_pool() result:" + # begin-update_load_balancer_pool + + load_balancer_pool_patch_model = { name: "updated-my-load-balancer-pool" } + + load_balancer_pool = service.update_load_balancer_pool( + load_balancer_id: load_balancer_id, + id: load_balancer_pool_id, + load_balancer_pool_patch: load_balancer_pool_patch_model + ).result + + puts JSON.pretty_generate(load_balancer_pool) + + # end-update_load_balancer_pool + + puts "update_load_balancer_listener_policy() result:" + # begin-update_load_balancer_listener_policy + + load_balancer_listener_policy_patch_model = { name: "updated-my-load-balancer-listener-policy", + priority: "1", + target: { + 'id': load_balancer_pool_id + } } + + load_balancer_listener_policy = service.update_load_balancer_listener_policy( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + id: load_balancer_listener_policy_id, + load_balancer_listener_policy_patch: + load_balancer_listener_policy_patch_model + ).result + + puts JSON.pretty_generate(load_balancer_listener_policy) + + # end-update_load_balancer_listener_policy + + puts "list_load_balancer_pool_members() result:" + # begin-list_load_balancer_pool_members + + load_balancer_pool_member_collection = service.list_load_balancer_pool_members( + load_balancer_id: load_balancer_id, + pool_id: load_balancer_pool_id + ).result + + puts JSON.pretty_generate(load_balancer_pool_member_collection) + + # end-list_load_balancer_pool_members + + puts "create_load_balancer_pool_member() result:" + # begin-create_load_balancer_pool_member + + load_balancer_pool_member_target_prototype_model = { + 'id': instance_id, + 'name': "my-load-balancer-pool-member" + } + + load_balancer_pool_member = service.create_load_balancer_pool_member( + load_balancer_id: load_balancer_id, + pool_id: load_balancer_pool_id, + port: 80, + target: load_balancer_pool_member_target_prototype_model + ).result + + puts JSON.pretty_generate(load_balancer_pool_member) + + # end-create_load_balancer_pool_member + load_balancer_pool_member_id = load_balancer_pool_member["id"] + + puts "get_load_balancer_pool_member() result:" + # begin-get_load_balancer_pool_member + + load_balancer_pool_member = service.get_load_balancer_pool_member( + load_balancer_id: load_balancer_id, + pool_id: load_balancer_pool_id, + id: load_balancer_pool_member_id + ).result + + puts JSON.pretty_generate(load_balancer_pool_member) + + # end-get_load_balancer_pool_member + + puts "update_load_balancer_pool_member() result:" + # begin-update_load_balancer_pool_member + + load_balancer_pool_member_patch_model = { name: "updated-my-load-balancer-pool-member" } + + load_balancer_pool_member = service.update_load_balancer_pool_member( + load_balancer_id: load_balancer_id, + pool_id: load_balancer_pool_id, + id: load_balancer_pool_member_id, + load_balancer_pool_member_patch: + load_balancer_pool_member_patch_model + ).result + + puts JSON.pretty_generate(load_balancer_pool_member) + + # end-update_load_balancer_pool_member + + puts "replace_load_balancer_pool_members() result:" + # begin-replace_load_balancer_pool_members + + load_balancer_pool_member_target_prototype_model = { + 'id': instance_id_1 + } + + load_balancer_pool_member_prototype_model = { + 'port': 80, + 'target': load_balancer_pool_member_target_prototype_model + } + + load_balancer_pool_member_collection = service.replace_load_balancer_pool_members( + load_balancer_id: load_balancer_id, + pool_id: load_balancer_pool_id, + members: [load_balancer_pool_member_prototype_model] + ).result + + puts JSON.pretty_generate(load_balancer_pool_member_collection) + + # end-replace_load_balancer_pool_members + load_balancer_pool_member_id = load_balancer_pool_member_collection["members"][0]["id"] + # begin-delete_load_balancer_pool_member + + service.delete_load_balancer_pool_member( + load_balancer_id: load_balancer_id, + pool_id: load_balancer_pool_id, + id: load_balancer_pool_member_id + ) + + # end-delete_load_balancer_pool_member + + # begin-delete_load_balancer_pool + + service.delete_load_balancer_pool( + load_balancer_id: load_balancer_id, id: load_balancer_pool_id + ) + + # end-delete_load_balancer_pool + + # begin-delete_load_balancer_listener_policy_rule + + service.delete_load_balancer_listener_policy_rule( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + policy_id: load_balancer_listener_policy_id, + id: load_balancer_listener_policy_rule_id + ) + + # end-delete_load_balancer_listener_policy_rule + + # begin-delete_load_balancer_listener_policy + + service.delete_load_balancer_listener_policy( + load_balancer_id: load_balancer_id, + listener_id: load_balancer_listener_id, + id: load_balancer_listener_policy_id + ) + + # end-delete_load_balancer_listener_policy + + # begin-delete_load_balancer_listener + + service.delete_load_balancer_listener( + load_balancer_id: load_balancer_id, id: load_balancer_listener_id + ) + + # end-delete_load_balancer_listener + + # begin-delete_load_balancer + + service.delete_load_balancer(id: load_balancer_id) + + # end-delete_load_balancer + end + + def test_endpoint_gateway_example + vpc = service.create_vpc(name: "my-vpc-endpoint-gateway").result + vpc_id = vpc["id"] + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-endpoint-gateway" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + subnet_id = subnet["id"] + reserved_ip = service.create_subnet_reserved_ip( + subnet_id: subnet_id + ).result + reserved_ip_id = reserved_ip["id"] + puts "list_endpoint_gateways() result:" + # begin-list_endpoint_gateways + + endpoint_gateway_collection = service.list_endpoint_gateways + .result + + puts JSON.pretty_generate(endpoint_gateway_collection) + + # end-list_endpoint_gateways + + puts "create_endpoint_gateway() result:" + # begin-create_endpoint_gateway + + endpoint_gateway_target_prototype_model = { + 'resource_type': + "provider_infrastructure_service", + 'crn': + "crn:v1:bluemix:public:cloudant:us-east:a/123456:3527280b-9327-4411-8020-591092e60353::" + } + + vpc_identity_model = { + 'id': vpc_id + } + + endpoint_gateway = service.create_endpoint_gateway( + target: endpoint_gateway_target_prototype_model, + vpc: vpc_identity_model + ).result + + puts JSON.pretty_generate(endpoint_gateway) + + # end-create_endpoint_gateway + endpoint_gateway_id = endpoint_gateway["id"] + + puts "list_endpoint_gateway_ips() result:" + # begin-list_endpoint_gateway_ips + + reserved_ip_collection_endpoint_gateway_context = service.list_endpoint_gateway_ips( + endpoint_gateway_id: endpoint_gateway_id + ).result + + puts JSON.pretty_generate(reserved_ip_collection_endpoint_gateway_context) + + # end-list_endpoint_gateway_ips + + puts "add_endpoint_gateway_ip() result:" + # begin-add_endpoint_gateway_ip + + reserved_ip = service.add_endpoint_gateway_ip( + endpoint_gateway_id: endpoint_gateway_id, id: reserved_ip_id + ).result + + puts JSON.pretty_generate(reserved_ip) + + # end-add_endpoint_gateway_ip + + puts "get_endpoint_gateway_ip() result:" + # begin-get_endpoint_gateway_ip + + reserved_ip = service.get_endpoint_gateway_ip( + endpoint_gateway_id: endpoint_gateway_id, id: reserved_ip_id + ).result + + puts JSON.pretty_generate(reserved_ip) + + # end-get_endpoint_gateway_ip + + puts "get_endpoint_gateway() result:" + # begin-get_endpoint_gateway + + endpoint_gateway = service.get_endpoint_gateway( + id: endpoint_gateway_id + ).result + + puts JSON.pretty_generate(endpoint_gateway) + + # end-get_endpoint_gateway + + puts "update_endpoint_gateway() result:" + # begin-update_endpoint_gateway + + endpoint_gateway_patch_model = { name: "updated-my-endpoint-gateway" } + + endpoint_gateway = service.update_endpoint_gateway( + id: endpoint_gateway_id, + endpoint_gateway_patch: endpoint_gateway_patch_model + ).result + + puts JSON.pretty_generate(endpoint_gateway) + + # end-update_endpoint_gateway + + # begin-remove_endpoint_gateway_ip + + service.remove_endpoint_gateway_ip( + endpoint_gateway_id: endpoint_gateway_id, id: reserved_ip_id + ) + + # end-remove_endpoint_gateway_ip + + # begin-delete_endpoint_gateway + + service.delete_endpoint_gateway(id: endpoint_gateway_id) + + # end-delete_endpoint_gateway + end + + def test_flowlog_example + vpc = service.create_vpc(name: "my-vpc-flow-log").result + vpc_id = vpc["id"] + puts "list_flow_log_collectors() result:" + # begin-list_flow_log_collectors + + flow_log_collector_collection = service.list_flow_log_collectors + .result + + puts JSON.pretty_generate(flow_log_collector_collection) + + # end-list_flow_log_collectors + + puts "create_flow_log_collector() result:" + # begin-create_flow_log_collector + + cloud_object_storage_bucket_identity_model = { + 'name': "bucket-27200-lwx4cfvcue" + } + + flow_log_collector_target_prototype_model = { + 'id': vpc_id + } + + flow_log_collector = service.create_flow_log_collector( + storage_bucket: cloud_object_storage_bucket_identity_model, + target: flow_log_collector_target_prototype_model, + name: "my-flow-log" + ).result + + puts JSON.pretty_generate(flow_log_collector) + + # end-create_flow_log_collector + flow_log_collector_id = flow_log_collector["id"] + puts "get_flow_log_collector() result:" + # begin-get_flow_log_collector + + flow_log_collector = service.get_flow_log_collector( + id: flow_log_collector_id + ).result + + puts JSON.pretty_generate(flow_log_collector) + + # end-get_flow_log_collector + + puts "update_flow_log_collector() result:" + # begin-update_flow_log_collector + + flow_log_collector_patch_model = { name: "updated-my-flow-log" } + + flow_log_collector = service.update_flow_log_collector( + id: flow_log_collector_id, + flow_log_collector_patch: flow_log_collector_patch_model + ).result + + puts JSON.pretty_generate(flow_log_collector) + + # end-update_flow_log_collector + + # begin-delete_flow_log_collector + + service.delete_flow_log_collector(id: flow_log_collector_id) + + # end-delete_flow_log_collector + end + + def test_bare_metal_servers + vpc = service.create_vpc(name: "my-vpc-bare-metal").result + vpc_id = vpc["id"] + + subnet_prototype_model = { + 'vpc': { + 'id': vpc_id + }, + 'total_ipv4_address_count': 256, + 'zone': { + 'name': "us-east-1" + }, + 'name': "my-subnet-bare-metal" + } + + subnet = service.create_subnet( + subnet_prototype: subnet_prototype_model + ).result + + subnet_id = subnet["id"] + + # reserved_ip = service.create_subnet_reserved_ip( + # name: "my-bm-reserved-ip", + # subnet_id: subnet_id + # ).result + # reserved_ip_id = reserved_ip["id"] + + puts "list_bare_metal_server_profiles() result " + # begin-list_bare_metal_server_profiles + + bare_metal_server_profile_collection = service.list_bare_metal_server_profiles.result + + # end-list_bare_metal_server_profiles + assert !bare_metal_server_profile_collection.nil? + + puts "get_bare_metal_server_profile() result " + # begin-get_bare_metal_server_profile + + bare_metal_server_profile = service.get_bare_metal_server_profile( + name: "bmhbx2-24x384" + ).result + + # end-get_bare_metal_server_profile + assert !bare_metal_server_profile.nil? + + puts "list_bare_metal_servers() result " + # begin-list_bare_metal_servers + + bare_metal_server_collection = service.list_bare_metal_servers.result + + # end-list_bare_metal_servers + assert !bare_metal_server_collection.nil? + + image_file_prototype_model = {} + image_file_prototype_model["href"] = "cos://us-south/my-bucket/my-image.qcow2" + + operating_system_identity_model = {} + operating_system_identity_model["name"] = "debian-9-amd64" + + image_prototype_model = {} + image_prototype_model["file"] = image_file_prototype_model + image_prototype_model["operating_system"] = operating_system_identity_model + image_prototype_model["name"] = "my-image-baremetal" + + image = service.create_image(image_prototype: image_prototype_model).result + image_id = image["id"] + + key = service.create_key( + public_key: + "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", + name: "my-ssh-key-bare-metal" + ).result + key_id = key["id"] + puts "create_bare_metal_server() result " + # begin-create_bare_metal_server + + image_identity_model = { + 'id': image_id + } + + key_identity_model = { + 'id': key_id + } + + bare_metal_server_initialization_prototype_model = { + 'image': image_identity_model, + 'keys': [key_identity_model] + } + + bare_metal_server_primary_network_interface_prototype_model = { + 'subnet': { + 'id': subnet_id + } + } + + zone_identity_model = { + 'name': "us-east-1" + } + + bare_metal_server = service.create_bare_metal_server( + initialization: bare_metal_server_initialization_prototype_model, + primary_network_interface: + bare_metal_server_primary_network_interface_prototype_model, + profile: { + 'name': "bmx2-48x768" + }, + name: "my-baremetal-server", + zone: zone_identity_model + ).result + + # end-create_bare_metal_server + assert !bare_metal_server.nil? + + bare_metal_id = bare_metal_server["id"] + + puts "get_bare_metal_server_initialization() result" + # begin-get_bare_metal_server_initialization + + bare_metal_server_initialization = service.get_bare_metal_server_initialization( + id: bare_metal_id + ).result + + # end-get_bare_metal_server_initialization + assert !bare_metal_server_initialization.nil? + + puts "create_bare_metal_server_console_access_token() result " + # begin-create_bare_metal_server_console_access_token + + # bare_metal_server_console_access_token = service.create_bare_metal_server_console_access_token( + # bare_metal_server_id: bare_metal_id, + # console_type: "serial" + # ).result + + # end-create_bare_metal_server_console_access_token + # assert !bare_metal_server_console_access_token.nil? + + puts "list_bare_metal_server_disks() result " + # begin-list_bare_metal_server_disks + + bare_metal_server_disk_collection = service.list_bare_metal_server_disks( + bare_metal_server_id: bare_metal_id + ).result + # end-list_bare_metal_server_disks + assert bare_metal_server_disk_collection + bare_metal_disk_id = bare_metal_server_disk_collection["disks"][0]["id"] + + puts "get_bare_metal_server_disk() result" + # begin-get_bare_metal_server_disk + + bare_metal_server_disk = service.get_bare_metal_server_disk( + bare_metal_server_id: bare_metal_id, + id: bare_metal_disk_id + ).result + + # end-get_bare_metal_server_disk + assert !bare_metal_server_disk.nil? + + puts "create_bare_metal_server_console_access_token() result" + # begin-create_bare_metal_server_console_access_token + + # bare_metal_server_console_access_token = service.create_bare_metal_server_console_access_token( + # bare_metal_server_id: bare_metal_id, + # console_type: "serial" + # ).result + + # puts JSON.pretty_generate(bare_metal_server_console_access_token) + + # end-create_bare_metal_server_console_access_token + + puts "update_bare_metal_server_disk() result" + # begin-update_bare_metal_server_disk + + bare_metal_server_disk_patch_model = {} + + bare_metal_server_disk = service.update_bare_metal_server_disk( + bare_metal_server_id: bare_metal_id, + id: bare_metal_disk_id, + bare_metal_server_disk_patch: bare_metal_server_disk_patch_model + ).result + + # end-update_bare_metal_server_disk + assert !bare_metal_server_disk.nil? + + puts "list_bare_metal_server_network_interfaces() result" + # begin-list_bare_metal_server_network_interfaces + + bare_metal_server_network_interface_collection = service.list_bare_metal_server_network_interfaces( + bare_metal_server_id: bare_metal_id + ).result + + # end-list_bare_metal_server_network_interfaces + assert !bare_metal_server_network_interface_collection.nil? + + puts "create_bare_metal_server_network_interface() result" + # begin-create_bare_metal_server_network_interface + + bare_metal_server_network_interface_prototype_model = { + 'interface_type': "vlan", + 'subnet': { + 'id': subnet_id + }, + 'vlan': 4 + } + + bare_metal_server_network_interface = service.create_bare_metal_server_network_interface( + bare_metal_server_id: bare_metal_id, + bare_metal_server_network_interface_prototype: + bare_metal_server_network_interface_prototype_model + ).result + + # end-create_bare_metal_server_network_interface + assert !bare_metal_server_network_interface.nil? + bm_nic_id = bare_metal_server_network_interface["id"] + + puts "get_bare_metal_server_network_interface() result" + # begin-get_bare_metal_server_network_interface + + bare_metal_server_network_interface = service.get_bare_metal_server_network_interface( + bare_metal_server_id: bare_metal_id, + id: bm_nic_id + ).result + + # end-get_bare_metal_server_network_interface + assert !bare_metal_server_network_interface.nil? + + puts "update_bare_metal_server_network_interface() result" + # begin-update_bare_metal_server_network_interface + + bare_metal_server_network_interface_patch_model = { + 'name': "my-network-interface-updated" + } + + bare_metal_server_network_interface = service.update_bare_metal_server_network_interface( + bare_metal_server_id: bare_metal_id, + id: bm_nic_id, + bare_metal_server_network_interface_patch: + bare_metal_server_network_interface_patch_model + ).result + + # end-update_bare_metal_server_network_interface + assert !bare_metal_server_network_interface.nil? + + zone_identity_model = { + 'name': "us-east-1" + } + + floating_ip_prototype_model = { + 'zone': zone_identity_model + } + + floating_ip = service.create_floating_ip( + floating_ip_prototype: floating_ip_prototype_model + ).result + floating_ip_id = floating_ip["id"] + + # Commenting for now as mock does not support these APIs + # puts "list_bare_metal_server_network_interface_ips() result:" + # # begin-list_bare_metal_server_network_interface_ips + + # reserved_ips = service.list_bare_metal_server_network_interface_ips( + # bare_metal_server_id: bare_metal_id, + # network_interface_id: bm_nic_id + # ).result + + # # end-list_bare_metal_server_network_interface_ips + # assert !reserved_ips.nil? + + # puts "get_bare_metal_server_network_interface_ip() result:" + # # begin-get_bare_metal_server_network_interface_ip + + # reserved_ip = service.get_bare_metal_server_network_interface_ip( + # bare_metal_server_id: bare_metal_id, + # network_interface_id: bm_nic_id, + # id: reserved_ip_id + # ).result + + # # end-get_bare_metal_server_network_interface_ip + # assert !reserved_ip.nil? + + print( + '\nadd_bare_metal_server_network_interface_floating_ip() result:' + ) + # begin-add_bare_metal_server_network_interface_floating_ip + + floating_ip = service.add_bare_metal_server_network_interface_floating_ip( + bare_metal_server_id: bare_metal_id, + network_interface_id: bm_nic_id, + id: floating_ip_id + ).result + + # end-add_bare_metal_server_network_interface_floating_ip + assert !floating_ip.nil? + + print( + '\nlist_bare_metal_server_network_interface_floating_ips() result:' + ) + # begin-list_bare_metal_server_network_interface_floating_ips + + floating_ip_unpaginated_collection = service.list_bare_metal_server_network_interface_floating_ips( + bare_metal_server_id: bare_metal_id, + network_interface_id: bm_nic_id + ).result + + # end-list_bare_metal_server_network_interface_floating_ips + assert !floating_ip_unpaginated_collection.nil? + bm_nic_fip_id = floating_ip_unpaginated_collection["floating_ips"][0]["id"] + + puts "get_bare_metal_server_network_interface_floating_ip() result:" + # begin-get_bare_metal_server_network_interface_floating_ip + + floating_ip = service.get_bare_metal_server_network_interface_floating_ip( + bare_metal_server_id: bare_metal_id, + network_interface_id: bm_nic_id, + id: bm_nic_fip_id + ).result + + # end-get_bare_metal_server_network_interface_floating_ip + assert !floating_ip.nil? + + puts "get_bare_metal_server() result" + # begin-get_bare_metal_server + + bare_metal_server = service.get_bare_metal_server( + id: bare_metal_id + ).result + + # end-get_bare_metal_server + assert !bare_metal_server.nil? + + puts "update_bare_metal_server() result" + # begin-update_bare_metal_server + + bare_metal_server_patch_model = { + 'name': "my-baremetal-server-updated" + } + + bare_metal_server = service.update_bare_metal_server( + id: bare_metal_id, + bare_metal_server_patch: bare_metal_server_patch_model + ).result + + # end-update_bare_metal_server + assert !bare_metal_server.nil? + + # begin-restart_bare_metal_server + + service.restart_bare_metal_server( + id: bare_metal_id + ) + + # end-restart_bare_metal_server + + # begin-start_bare_metal_server + + service.start_bare_metal_server( + id: bare_metal_id + ) + + # end-start_bare_metal_server + + # begin-stop_bare_metal_server + + service.stop_bare_metal_server( + id: bare_metal_id, type: "soft" + ) + + # end-stop_bare_metal_server + + # begin-remove_bare_metal_server_network_interface_floating_ip + + service.remove_bare_metal_server_network_interface_floating_ip( + bare_metal_server_id: bare_metal_id, + network_interface_id: bm_nic_id, + id: bm_nic_fip_id + ) + + # end-remove_bare_metal_server_network_interface_floating_ip + + # begin-delete_bare_metal_server_network_interface + + service.delete_bare_metal_server_network_interface( + bare_metal_server_id: bare_metal_id, id: bm_nic_id + ) + + # end-delete_bare_metal_server_network_interface + + # begin-delete_bare_metal_server + + service.delete_bare_metal_server(id: bare_metal_id) + + # end-delete_bare_metal_server + end + end +else + class VpcV1Test < Minitest::Test + def test_missing_credentials_skip_example + skip "Skip VPC example tests because credentials have not been provided" + end + end +end diff --git a/test/unit/test_vpc_v1.rb b/test/unit/test_vpc_v1.rb index a06dfa5..05d11e6 100644 --- a/test/unit/test_vpc_v1.rb +++ b/test/unit/test_vpc_v1.rb @@ -38,7 +38,7 @@ def test_list_vpcs "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" @@ -57,7 +57,7 @@ def test_create_vpc "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -73,7 +73,7 @@ def test_delete_vpc "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -113,7 +113,7 @@ def test_get_vpc "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -132,7 +132,7 @@ def test_update_vpc "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -149,7 +149,7 @@ def test_get_vpc_default_network_acl "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/default_network_acl?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/default_network_acl?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -165,7 +165,7 @@ def test_get_vpc_default_routing_table "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/default_routing_table?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/default_routing_table?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -181,7 +181,7 @@ def test_get_vpc_default_security_group "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/default_security_group?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/default_security_group?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -203,7 +203,7 @@ def test_list_vpc_address_prefixes "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -219,7 +219,7 @@ def test_create_vpc_address_prefix "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" }, body: { "cidr" => "10.1.0.0/16", @@ -246,7 +246,7 @@ def test_delete_vpc_address_prefix "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -265,7 +265,7 @@ def test_get_vpc_address_prefix "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -280,12 +280,12 @@ def test_get_vpc_address_prefix def test_update_vpc_address_prefix message_response = { "cidr" => "10.1.0.0/16", "created_at" => "2019-01-07T16:56:54Z", "has_subnets" => false, - "href" => "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-03-29", "id" => "df760133-3513-47e7-b980-26cca666561b", "is_default" => false, "name" => "my-vpc-address-prefix-1-updated", "zone" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name" => "us-south-1" } } + "href" => "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-09-13", "id" => "df760133-3513-47e7-b980-26cca666561b", "is_default" => false, "name" => "my-vpc-address-prefix-1-updated", "zone" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name" => "us-south-1" } } headers = { "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/address_prefixes/df760133-3513-47e7-b980-26cca666561b?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -305,7 +305,7 @@ def test_list_vpc_routes "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/routes?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f64efe74-a5a2-45c7-b37d-5071d2dd6339/routes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -324,7 +324,7 @@ def test_create_vpc_route "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -348,7 +348,7 @@ def test_delete_vpc_route "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -366,7 +366,7 @@ def test_get_vpc_route "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -386,7 +386,7 @@ def test_update_vpc_route "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -406,7 +406,7 @@ def test_list_vpc_routing_tables "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -425,7 +425,7 @@ def test_create_vpc_routing_table "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -443,7 +443,7 @@ def test_delete_vpc_routing_table "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -461,7 +461,7 @@ def test_get_vpc_routing_table "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -480,7 +480,7 @@ def test_update_vpc_routing_table "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -505,7 +505,7 @@ def test_list_vpc_routing_table_routes "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe/routes?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe/routes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -525,7 +525,7 @@ def test_create_vpc_routing_table_route "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe/routes?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/eee6e0f4-ff31-41b4-8584-3cdd50b8fffe/routes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -550,7 +550,7 @@ def test_delete_vpc_routing_table_route "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -570,7 +570,7 @@ def test_get_vpc_routing_table_route "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -591,7 +591,7 @@ def test_update_vpc_routing_table_route "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpcs/128c1fcf-79bc-40d0-88a1-b7c58f05cf5b/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/9cdddd42-8ce1-4ca9-ba65-06ffd4d6cf19?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -614,7 +614,7 @@ def test_list_subnets "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -631,7 +631,7 @@ def test_create_subnet "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/subnets?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/subnets?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -649,7 +649,7 @@ def test_delete_subnet "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -666,7 +666,7 @@ def test_get_subnet "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -685,7 +685,7 @@ def test_update_subnet "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -705,7 +705,7 @@ def test_get_subnet_network_acl "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959/network_acl?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959/network_acl?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -724,7 +724,7 @@ def test_replace_subnet_network_acl "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959/network_acl?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959/network_acl?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -743,7 +743,7 @@ def test_unset_subnet_public_gateway "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959/public_gateway?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/subnets/8722d01c-9c78-4555-82b5-53ad1266f959/public_gateway?generation=2&version=2022-09-13") .with( headers: { "Host" => "us-south.iaas.cloud.ibm.com" } ) @@ -760,7 +760,7 @@ def test_get_subnet_public_gateway "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/d4d3ef82-bebb-446e-bbe4-038bc82f6776/public_gateway?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/d4d3ef82-bebb-446e-bbe4-038bc82f6776/public_gateway?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -779,7 +779,7 @@ def test_set_subnet_public_gateway "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/subnets/4fd00a61-fe63-4186-81c9-f7253b5c1cd7/public_gateway?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/subnets/4fd00a61-fe63-4186-81c9-f7253b5c1cd7/public_gateway?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -799,7 +799,7 @@ def test_get_subnet_routing_table "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/6885e83f-03b2-4603-8a86-db2a0f55c840/routing_table?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/6885e83f-03b2-4603-8a86-db2a0f55c840/routing_table?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -818,7 +818,7 @@ def test_replace_subnet_routing_table "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/subnets/6885e83f-03b2-4603-8a86-db2a0f55c840/routing_table?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/subnets/6885e83f-03b2-4603-8a86-db2a0f55c840/routing_table?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -842,7 +842,7 @@ def test_list_subnet_reserved_ips "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -861,7 +861,7 @@ def test_create_subnet_reserved_ip "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -879,7 +879,7 @@ def test_delete_subnet_reserved_ip "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_subnet_reserved_ip( subnet_id: "0716-b28a7e6d-a66b-4de7-8713-15dcffdce401", @@ -894,7 +894,7 @@ def test_get_subnet_reserved_ip "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -914,7 +914,7 @@ def test_update_subnet_reserved_ip "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -935,7 +935,7 @@ def test_list_images "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/images?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/images?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -952,7 +952,7 @@ def test_create_image "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/images?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/images?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -970,7 +970,7 @@ def test_delete_image "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/images/72251a2e-d6c5-42b4-97b0-b5f8e8d1f479?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/images/72251a2e-d6c5-42b4-97b0-b5f8e8d1f479?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_image( id: "72251a2e-d6c5-42b4-97b0-b5f8e8d1f479" @@ -984,7 +984,7 @@ def test_get_image "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/images/72251a2e-d6c5-42b4-97b0-b5f8e8d1f479?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/images/72251a2e-d6c5-42b4-97b0-b5f8e8d1f479?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1003,7 +1003,7 @@ def test_update_image "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/images/72251a2e-d6c5-42b4-97b0-b5f8e8d1f479?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/images/72251a2e-d6c5-42b4-97b0-b5f8e8d1f479?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1023,7 +1023,7 @@ def test_list_operating_systems "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1040,7 +1040,7 @@ def test_get_operating_system "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/red-7-amd64?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/red-7-amd64?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1059,7 +1059,7 @@ def test_list_placement_groups "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1076,7 +1076,7 @@ def test_create_placement_group "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1094,7 +1094,7 @@ def test_delete_placement_group "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_placement_group( id: "3fad3f2204eb4998c3964d254ffcd771" @@ -1108,7 +1108,7 @@ def test_get_placement_group "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1127,7 +1127,7 @@ def test_update_placement_group "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1147,7 +1147,7 @@ def test_list_keys "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/keys?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/keys?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1164,7 +1164,7 @@ def test_create_key "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/keys?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/keys?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1182,7 +1182,7 @@ def test_delete_key "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/keys/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/keys/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_key( id: "3fad3f2204eb4998c3964d254ffcd771" @@ -1196,7 +1196,7 @@ def test_get_key "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/keys/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/keys/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1215,7 +1215,7 @@ def test_update_key "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/keys/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/keys/3fad3f2204eb4998c3964d254ffcd771?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1235,7 +1235,7 @@ def test_list_instance_profiles "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1252,7 +1252,7 @@ def test_get_instance_profile "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-8x32?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-8x32?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1271,7 +1271,7 @@ def test_list_instance_templates "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1290,7 +1290,7 @@ def test_create_instance_template "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" }, body: '{"image":{"id":"3f9a2d96-830e-4100-9b4c-663225a3f872"},"keys":[{"id":"363f6d70-0000-0001-0000-00000013b96c"}],"name":"my-instance-template","primary_network_interface":{"subnet":{"id":"0d933c75-492a-4756-9832-1200585dfa79"}},"profile":{"name":"bx2-2x8"},"vpc":{"id":"dc201ab2-8536-4904-86a8-084d84582133"},"zone":{"name":"us-south-1"}}' @@ -1333,7 +1333,7 @@ def test_delete_instance_template "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/3f9a2d96-830e-4100-9b4c-663225a3f872?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/3f9a2d96-830e-4100-9b4c-663225a3f872?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_template( id: "3f9a2d96-830e-4100-9b4c-663225a3f872" @@ -1349,7 +1349,7 @@ def test_get_instance_template "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/3f9a2d96-830e-4100-9b4c-663225a3f872?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/3f9a2d96-830e-4100-9b4c-663225a3f872?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1370,7 +1370,7 @@ def test_update_instance_template "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/3f9a2d96-830e-4100-9b4c-663225a3f872?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/3f9a2d96-830e-4100-9b4c-663225a3f872?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1390,7 +1390,7 @@ def test_list_instances "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1407,7 +1407,7 @@ def test_create_instance "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1478,7 +1478,7 @@ def test_delete_instance "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance( id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0" @@ -1492,7 +1492,7 @@ def test_get_instance "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1511,7 +1511,7 @@ def test_update_instance "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1531,7 +1531,7 @@ def test_list_instance_disks "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/disks?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/disks?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1550,7 +1550,7 @@ def test_get_instance_disk "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/disks/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/disks/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1570,7 +1570,7 @@ def test_update_instance_disk "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/disks/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/disks/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1591,7 +1591,7 @@ def test_get_instance_initialization "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/initialization?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/initialization?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1610,7 +1610,7 @@ def test_create_instance_console_access_token "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/console_access_token?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/console_access_token?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1630,7 +1630,7 @@ def test_create_instance_action "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/actions?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/actions?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1650,7 +1650,7 @@ def test_list_instance_network_interfaces "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1702,7 +1702,7 @@ def test_create_instance_network_interface "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1726,7 +1726,7 @@ def test_delete_instance_network_interface "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_network_interface( instance_id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", @@ -1774,7 +1774,7 @@ def test_get_instance_network_interface "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1827,7 +1827,7 @@ def test_update_instance_network_interface "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1848,7 +1848,7 @@ def test_list_instance_network_interface_floating_ips "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1867,7 +1867,7 @@ def test_remove_instance_network_interface_floating_ip "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.remove_instance_network_interface_floating_ip( instance_id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", @@ -1883,7 +1883,7 @@ def test_get_instance_network_interface_floating_ip "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1904,7 +1904,7 @@ def test_add_instance_network_interface_floating_ip "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1925,7 +1925,7 @@ def test_list_snapshots "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/snapshots?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/snapshots?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1942,7 +1942,7 @@ def test_create_snapshot "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/snapshots?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/snapshots?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1969,7 +1969,7 @@ def test_get_snapshot "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -1988,7 +1988,7 @@ def test_update_snapshot "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2001,12 +2001,84 @@ def test_update_snapshot assert_equal(message_response, service_response.result) end + def test_list_snapshot_clones + message_response = { "bandwidth" => 4000, + "boot_volume_attachment" => { "device" => { "id" => "a8a15363-a6f7-4f01-af60-715e85b28141" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141", "id" => "a8a15363-a6f7-4f01-af60-715e85b28141", "name" => "my-boot-volume-attachment", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916", "id" => "49c5d61b-41e7-4c01-9b7a-1a97366c6916", "name" => "my-boot-volume" } }, "created_at" => "2020-03-26T16:11:57Z", "crn" => "crn:[...]", "dedicated_host" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "id" => "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "name" => "test-new", "resource_type" => "dedicated_host" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0", "id" => "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", "image" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/images/9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366", "id" => "9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366", "name" => "my-image" }, "memory" => 8, "name" => "my-instance", "network_interfaces" => [{ "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275", "id" => "7ca88dfb-8962-469d-b1de-1dd56f4c3275", "name" => "my-network-interface", "primary_ipv4_address" => "10.0.0.32", "resource_type" => "network_interface", "subnet" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/subnets/7389-bea6a632-5e13-42a4-b4b8-31dc877abfe4", "id" => "bea6a632-5e13-42a4-b4b8-31dc877abfe4", "name" => "my-subnet" } }], "placement_target" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "id" => "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "name" => "test-new", "resource_type" => "dedicated_host" }, "primary_network_interface" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275", "id" => "7ca88dfb-8962-469d-b1de-1dd56f4c3275", "name" => "my-network-interface", "primary_ipv4_address" => "10.0.0.32", "resource_type" => "network_interface", "subnet" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/subnets/bea6a632-5e13-42a4-b4b8-31dc877abfe4", "id" => "bea6a632-5e13-42a4-b4b8-31dc877abfe4", "name" => "my-subnet" } }, "profile" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8", "name" => "bx2-2x8" }, "resource_group" => { "href" => "https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21", "id" => "4bbce614c13444cd8fc5e7e878ef8e21", "name" => "Default" }, "status" => "running", "vcpu" => { "architecture" => "amd64", "count" => 2 }, "volume_attachments" => [{ "device" => { "id" => "a8a15363-a6f7-4f01-af60-715e85b28141" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141", "id" => "a8a15363-a6f7-4f01-af60-715e85b28141", "name" => "my-boot-volume-attachment", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916", "id" => "49c5d61b-41e7-4c01-9b7a-1a97366c6916", "name" => "my-boot-volume" } }, { "device" => { "id" => "e77125cb-4df0-4988-a878-531ae0ae0b70" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/volume_attachments/7389-e77125cb-4df0-4988-a878-531ae0ae0b70", "id" => "e77125cb-4df0-4988-a878-531ae0ae0b70", "name" => "my-volume-attachment-1", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/2cc091f5-4d46-48f3-99b7-3527ae3f4392", "id" => "2cc091f5-4d46-48f3-99b7-3527ae3f4392", "name" => "my-data-volume" } }], "vpc" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f0aae929-7047-46d1-92e1-9102b07a7f6f", "id" => "f0aae929-7047-46d1-92e1-9102b07a7f6f", "name" => "my-vpc" }, "zone" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name" => "us-south-1" } } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/clones?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.list_snapshot_clones( + id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0" + ) + + assert_equal(message_response, service_response.result) + end + + def test_get_snapshot_clone + message_response = { "bandwidth" => 4000, + "boot_volume_attachment" => { "device" => { "id" => "a8a15363-a6f7-4f01-af60-715e85b28141" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141", "id" => "a8a15363-a6f7-4f01-af60-715e85b28141", "name" => "my-boot-volume-attachment", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916", "id" => "49c5d61b-41e7-4c01-9b7a-1a97366c6916", "name" => "my-boot-volume" } }, "created_at" => "2020-03-26T16:11:57Z", "crn" => "crn:[...]", "dedicated_host" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "id" => "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "name" => "test-new", "resource_type" => "dedicated_host" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0", "id" => "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", "image" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/images/9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366", "id" => "9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366", "name" => "my-image" }, "memory" => 8, "name" => "my-instance", "network_interfaces" => [{ "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275", "id" => "7ca88dfb-8962-469d-b1de-1dd56f4c3275", "name" => "my-network-interface", "primary_ipv4_address" => "10.0.0.32", "resource_type" => "network_interface", "subnet" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/subnets/7389-bea6a632-5e13-42a4-b4b8-31dc877abfe4", "id" => "bea6a632-5e13-42a4-b4b8-31dc877abfe4", "name" => "my-subnet" } }], "placement_target" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "id" => "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "name" => "test-new", "resource_type" => "dedicated_host" }, "primary_network_interface" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275", "id" => "7ca88dfb-8962-469d-b1de-1dd56f4c3275", "name" => "my-network-interface", "primary_ipv4_address" => "10.0.0.32", "resource_type" => "network_interface", "subnet" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/subnets/bea6a632-5e13-42a4-b4b8-31dc877abfe4", "id" => "bea6a632-5e13-42a4-b4b8-31dc877abfe4", "name" => "my-subnet" } }, "profile" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8", "name" => "bx2-2x8" }, "resource_group" => { "href" => "https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21", "id" => "4bbce614c13444cd8fc5e7e878ef8e21", "name" => "Default" }, "status" => "running", "vcpu" => { "architecture" => "amd64", "count" => 2 }, "volume_attachments" => [{ "device" => { "id" => "a8a15363-a6f7-4f01-af60-715e85b28141" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141", "id" => "a8a15363-a6f7-4f01-af60-715e85b28141", "name" => "my-boot-volume-attachment", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916", "id" => "49c5d61b-41e7-4c01-9b7a-1a97366c6916", "name" => "my-boot-volume" } }, { "device" => { "id" => "e77125cb-4df0-4988-a878-531ae0ae0b70" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/volume_attachments/7389-e77125cb-4df0-4988-a878-531ae0ae0b70", "id" => "e77125cb-4df0-4988-a878-531ae0ae0b70", "name" => "my-volume-attachment-1", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/2cc091f5-4d46-48f3-99b7-3527ae3f4392", "id" => "2cc091f5-4d46-48f3-99b7-3527ae3f4392", "name" => "my-data-volume" } }], "vpc" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f0aae929-7047-46d1-92e1-9102b07a7f6f", "id" => "f0aae929-7047-46d1-92e1-9102b07a7f6f", "name" => "my-vpc" }, "zone" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name" => "us-south-1" } } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/clones/us-east-1?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.get_snapshot_clone( + id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", + zone_name: "us-east-1" + ) + + assert_equal(message_response, service_response.result) + end + + def test_create_snapshot_clone + message_response = { "bandwidth" => 4000, + "boot_volume_attachment" => { "device" => { "id" => "a8a15363-a6f7-4f01-af60-715e85b28141" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141", "id" => "a8a15363-a6f7-4f01-af60-715e85b28141", "name" => "my-boot-volume-attachment", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916", "id" => "49c5d61b-41e7-4c01-9b7a-1a97366c6916", "name" => "my-boot-volume" } }, "created_at" => "2020-03-26T16:11:57Z", "crn" => "crn:[...]", "dedicated_host" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "id" => "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "name" => "test-new", "resource_type" => "dedicated_host" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0", "id" => "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", "image" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/images/9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366", "id" => "9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366", "name" => "my-image" }, "memory" => 8, "name" => "my-instance", "network_interfaces" => [{ "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275", "id" => "7ca88dfb-8962-469d-b1de-1dd56f4c3275", "name" => "my-network-interface", "primary_ipv4_address" => "10.0.0.32", "resource_type" => "network_interface", "subnet" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/subnets/7389-bea6a632-5e13-42a4-b4b8-31dc877abfe4", "id" => "bea6a632-5e13-42a4-b4b8-31dc877abfe4", "name" => "my-subnet" } }], "placement_target" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "id" => "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221", "name" => "test-new", "resource_type" => "dedicated_host" }, "primary_network_interface" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275", "id" => "7ca88dfb-8962-469d-b1de-1dd56f4c3275", "name" => "my-network-interface", "primary_ipv4_address" => "10.0.0.32", "resource_type" => "network_interface", "subnet" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/subnets/bea6a632-5e13-42a4-b4b8-31dc877abfe4", "id" => "bea6a632-5e13-42a4-b4b8-31dc877abfe4", "name" => "my-subnet" } }, "profile" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8", "name" => "bx2-2x8" }, "resource_group" => { "href" => "https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21", "id" => "4bbce614c13444cd8fc5e7e878ef8e21", "name" => "Default" }, "status" => "running", "vcpu" => { "architecture" => "amd64", "count" => 2 }, "volume_attachments" => [{ "device" => { "id" => "a8a15363-a6f7-4f01-af60-715e85b28141" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141", "id" => "a8a15363-a6f7-4f01-af60-715e85b28141", "name" => "my-boot-volume-attachment", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916", "id" => "49c5d61b-41e7-4c01-9b7a-1a97366c6916", "name" => "my-boot-volume" } }, { "device" => { "id" => "e77125cb-4df0-4988-a878-531ae0ae0b70" }, "href" => "https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/volume_attachments/7389-e77125cb-4df0-4988-a878-531ae0ae0b70", "id" => "e77125cb-4df0-4988-a878-531ae0ae0b70", "name" => "my-volume-attachment-1", "volume" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/volumes/2cc091f5-4d46-48f3-99b7-3527ae3f4392", "id" => "2cc091f5-4d46-48f3-99b7-3527ae3f4392", "name" => "my-data-volume" } }], "vpc" => { "crn" => "crn:[...]", "href" => "https://us-south.iaas.cloud.ibm.com/v1/vpcs/f0aae929-7047-46d1-92e1-9102b07a7f6f", "id" => "f0aae929-7047-46d1-92e1-9102b07a7f6f", "name" => "my-vpc" }, "zone" => { "href" => "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name" => "us-south-1" } } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/clones/us-east-1?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.create_snapshot_clone( + id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", + zone_name: "us-east-1" + ) + + assert_equal(message_response, service_response.result) + end + + def test_delete_snapshot_clone + headers = { + "Content-Type" => "application/json" + } + + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/clones/us-east-1?generation=2&version=2022-09-13") + .to_return(status: 200, body: "", headers: headers) + service.delete_snapshot_clone( + id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", + zone_name: "us-east-1" + ) + end + def test_delete_snapshot headers = { "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-09-13") .to_return(status: 200, body: "", headers: headers) service.delete_snapshot( id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60" @@ -2018,7 +2090,7 @@ def test_delete_snapshots "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/snapshots?generation=2&source_volume.id=r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/snapshots?generation=2&source_volume.id=r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60&version=2022-09-13") .to_return(status: 200, body: "", headers: headers) service.delete_snapshots( source_volume_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60" @@ -2034,7 +2106,7 @@ def test_list_instance_volume_attachments "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2053,7 +2125,7 @@ def test_create_instance_volume_attachment "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2073,7 +2145,7 @@ def test_delete_instance_volume_attachment "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_volume_attachment( instance_id: "eb1b7391-2ca2-4ab5-84a8-b92157a633b0", @@ -2088,7 +2160,7 @@ def test_get_instance_volume_attachment "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2108,7 +2180,7 @@ def test_update_instance_volume_attachment "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2129,7 +2201,7 @@ def test_list_instance_groups "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2146,7 +2218,7 @@ def test_create_instance_group "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2177,7 +2249,7 @@ def test_delete_instance_group "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.delete_instance_group( id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60" @@ -2191,7 +2263,7 @@ def test_get_instance_group "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-03-29?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-09-13?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2210,7 +2282,7 @@ def test_update_instance_group "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2229,7 +2301,7 @@ def test_delete_instance_group_load_balancer "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/load_balancer?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/load_balancer?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_group_load_balancer( instance_group_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60" @@ -2246,7 +2318,7 @@ def test_list_instance_group_managers "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2265,7 +2337,7 @@ def test_create_instance_group_manager "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2284,7 +2356,7 @@ def test_delete_instance_group_manager "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_group_manager( instance_group_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", @@ -2299,7 +2371,7 @@ def test_get_instance_group_manager "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2319,7 +2391,7 @@ def test_update_instance_group_manager "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2343,7 +2415,7 @@ def test_list_instance_group_manager_actions "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/actions?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/actions?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2363,7 +2435,7 @@ def test_create_instance_group_manager_actions "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/actions?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/actions?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2383,7 +2455,7 @@ def test_delete_instance_group_manager_actions "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/actions/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/actions/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_group_manager_action( instance_group_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", @@ -2399,7 +2471,7 @@ def test_get_instance_group_manager_actions "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/actions/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/actions/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2420,7 +2492,7 @@ def test_update_instance_group_manager_actions "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/actions/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/actions/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2445,7 +2517,7 @@ def test_list_instance_group_manager_policies "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2465,7 +2537,7 @@ def test_create_instance_group_manager_policy "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2485,7 +2557,7 @@ def test_delete_instance_group_manager_policy "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies/r018-02d7b6c3-e3c8-4569-ba6a-caa5d4d6146c?generation=2&version=2022-03-29?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies/r018-02d7b6c3-e3c8-4569-ba6a-caa5d4d6146c?generation=2&version=2022-09-13?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_group_manager_policy( instance_group_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", @@ -2501,7 +2573,7 @@ def test_get_instance_group_manager_policy "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies/r018-02d7b6c3-e3c8-4569-ba6a-caa5d4d6146c?generation=2&version=2022-03-29?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies/r018-02d7b6c3-e3c8-4569-ba6a-caa5d4d6146c?generation=2&version=2022-09-13?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2522,7 +2594,7 @@ def test_update_instance_group_manager_policy "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies/r018-02d7b6c3-e3c8-4569-ba6a-caa5d4d6146c?generation=2&version=2022-03-29?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/managers/r018-4f2f7036-86b0-4d1b-a729-12357d45b00f/policies/r018-02d7b6c3-e3c8-4569-ba6a-caa5d4d6146c?generation=2&version=2022-09-13?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2543,7 +2615,7 @@ def test_delete_instance_group_memberships "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_group_memberships( instance_group_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60" @@ -2561,7 +2633,7 @@ def test_list_instance_group_memberships "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2579,7 +2651,7 @@ def test_delete_instance_group_membership "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/04977d01-89c0-488b-a599-3d0dc32880e7?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/04977d01-89c0-488b-a599-3d0dc32880e7?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_instance_group_membership( instance_group_id: "r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60", @@ -2594,7 +2666,7 @@ def test_get_instance_group_membership "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/04977d01-89c0-488b-a599-3d0dc32880e7?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/04977d01-89c0-488b-a599-3d0dc32880e7?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2614,7 +2686,7 @@ def test_update_instance_group_membership "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/04977d01-89c0-488b-a599-3d0dc32880e7?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r018-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/04977d01-89c0-488b-a599-3d0dc32880e7?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2635,7 +2707,7 @@ def test_list_dedicated_host_groups "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2652,7 +2724,7 @@ def test_create_dedicated_host_group "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2668,7 +2740,7 @@ def test_delete_dedicated_host_group "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/4bbce614c13444cd8fc5e7e878ef8e21?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/4bbce614c13444cd8fc5e7e878ef8e21?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_dedicated_host_group( id: "4bbce614c13444cd8fc5e7e878ef8e21" @@ -2682,7 +2754,7 @@ def test_get_dedicated_host_group "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/4bbce614c13444cd8fc5e7e878ef8e21?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/4bbce614c13444cd8fc5e7e878ef8e21?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2701,7 +2773,7 @@ def test_update_dedicated_host_group "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/4bbce614c13444cd8fc5e7e878ef8e21?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/4bbce614c13444cd8fc5e7e878ef8e21?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2721,7 +2793,7 @@ def test_list_dedicated_host_profiles "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2738,7 +2810,7 @@ def test_get_dedicated_host_profile "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2759,7 +2831,7 @@ def test_list_dedicated_hosts "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2776,7 +2848,7 @@ def test_create_dedicated_host "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2801,7 +2873,7 @@ def test_delete_dedicated_host "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_dedicated_host( id: "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221" @@ -2815,7 +2887,7 @@ def test_get_dedicated_host "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2834,7 +2906,7 @@ def test_update_dedicated_host "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2854,7 +2926,7 @@ def test_list_dedicated_host_disks "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221/disks?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221/disks?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2873,7 +2945,7 @@ def test_get_dedicated_host_disk "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221/disks/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221/disks/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2893,7 +2965,7 @@ def test_update_dedicated_host_disk "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221/disks/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221/disks/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2914,7 +2986,7 @@ def test_list_volume_profiles "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2931,7 +3003,7 @@ def test_get_volume_profile "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/10iops-tier?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/10iops-tier?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2950,7 +3022,7 @@ def test_list_volumes "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volumes?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volumes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2967,7 +3039,7 @@ def test_create_volume "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/volumes?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/volumes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -2993,7 +3065,7 @@ def test_delete_volume "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/volumes/2d1bb5a8-40a8-447a-acf7-0eadc8aeb054?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/volumes/2d1bb5a8-40a8-447a-acf7-0eadc8aeb054?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_volume( id: "2d1bb5a8-40a8-447a-acf7-0eadc8aeb054" @@ -3007,7 +3079,7 @@ def test_get_volume "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volumes/2d1bb5a8-40a8-447a-acf7-0eadc8aeb054?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/volumes/2d1bb5a8-40a8-447a-acf7-0eadc8aeb054?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3026,7 +3098,7 @@ def test_update_volume "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/volumes/2d1bb5a8-40a8-447a-acf7-0eadc8aeb054?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/volumes/2d1bb5a8-40a8-447a-acf7-0eadc8aeb054?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3048,7 +3120,7 @@ def test_list_regions "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3065,7 +3137,7 @@ def test_get_region "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3087,7 +3159,7 @@ def test_list_region_zones "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3106,7 +3178,7 @@ def test_get_region_zone "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3126,7 +3198,7 @@ def test_list_public_gateways "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3143,7 +3215,7 @@ def test_create_public_gateway "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3162,7 +3234,7 @@ def test_delete_public_gateway "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/d4d3ef82-bebb-446e-bbe4-038bc82f6776?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/d4d3ef82-bebb-446e-bbe4-038bc82f6776?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_public_gateway( id: "d4d3ef82-bebb-446e-bbe4-038bc82f6776" @@ -3176,7 +3248,7 @@ def test_get_public_gateway "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/d4d3ef82-bebb-446e-bbe4-038bc82f6776?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/d4d3ef82-bebb-446e-bbe4-038bc82f6776?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3195,7 +3267,7 @@ def test_update_public_gateway "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/d4d3ef82-bebb-446e-bbe4-038bc82f6776?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/d4d3ef82-bebb-446e-bbe4-038bc82f6776?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3215,7 +3287,7 @@ def test_list_floating_ips "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3232,7 +3304,7 @@ def test_create_floating_ip "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3255,7 +3327,7 @@ def test_delete_floating_ip "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_floating_ip( id: "ad0cded3-53a3-4d4a-9809-8c59b50d2b80" @@ -3269,7 +3341,7 @@ def test_get_floating_ip "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3288,7 +3360,7 @@ def test_update_floating_ip "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/ad0cded3-53a3-4d4a-9809-8c59b50d2b80?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3308,7 +3380,7 @@ def test_list_network_acls "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3325,7 +3397,7 @@ def test_create_network_acl "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/network_acls?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/network_acls?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3348,7 +3420,7 @@ def test_delete_network_acl "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_network_acl( id: "3217cb8b-5368-452a-9399-a84f14fb539d" @@ -3362,7 +3434,7 @@ def test_get_network_acl "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3381,7 +3453,7 @@ def test_update_network_acl "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3405,7 +3477,7 @@ def test_list_network_acl_rules "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3424,7 +3496,7 @@ def test_create_network_acl_rule "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3443,7 +3515,7 @@ def test_delete_network_acl_rule "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules/cb19f11d-0e25-4650-a8ab-f4539da563ee?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules/cb19f11d-0e25-4650-a8ab-f4539da563ee?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_network_acl_rule( network_acl_id: "3217cb8b-5368-452a-9399-a84f14fb539d", @@ -3458,7 +3530,7 @@ def test_get_network_acl_rule "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules/cb19f11d-0e25-4650-a8ab-f4539da563ee?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules/cb19f11d-0e25-4650-a8ab-f4539da563ee?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3478,7 +3550,7 @@ def test_update_network_acl_rule "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules/cb19f11d-0e25-4650-a8ab-f4539da563ee?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/network_acls/3217cb8b-5368-452a-9399-a84f14fb539d/rules/cb19f11d-0e25-4650-a8ab-f4539da563ee?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3499,7 +3571,7 @@ def test_list_security_groups "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3516,7 +3588,7 @@ def test_create_security_group "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/security_groups?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/security_groups?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3534,7 +3606,7 @@ def test_delete_security_group "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_security_group( id: "2d364f0a-a870-42c3-a554-000001099037" @@ -3548,7 +3620,7 @@ def test_get_security_group "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3567,7 +3639,7 @@ def test_get_security_group_target "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/targets/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/targets/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3587,7 +3659,7 @@ def test_list_security_group_targets "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/targets?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/targets?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3606,7 +3678,7 @@ def test_create_security_group_target_binding "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/31cf397a-286a-4289-a7e7-92f177e7e491/targets/31cf397a-286a-4289-a7e7-92f177e7e491?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/31cf397a-286a-4289-a7e7-92f177e7e491/targets/31cf397a-286a-4289-a7e7-92f177e7e491?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3623,7 +3695,7 @@ def test_delete_security_group_target_binding "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/targets/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/targets/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-09-13") .to_return(status: 204, body: "", headers: headers) service.delete_security_group_target_binding( security_group_id: "2d364f0a-a870-42c3-a554-000001099037", @@ -3638,7 +3710,7 @@ def test_update_security_group "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3660,7 +3732,7 @@ def test_list_security_group_rules "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3679,7 +3751,7 @@ def test_create_security_group_rule "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3698,7 +3770,7 @@ def test_delete_security_group_rule "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules/b597cff2-38e8-4e6e-999d-000002173027?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules/b597cff2-38e8-4e6e-999d-000002173027?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_security_group_rule( security_group_id: "2d364f0a-a870-42c3-a554-000001099037", @@ -3713,7 +3785,7 @@ def test_get_security_group_rule "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules/b597cff2-38e8-4e6e-999d-000002173027?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules/b597cff2-38e8-4e6e-999d-000002173027?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3733,7 +3805,7 @@ def test_update_security_group_rule "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules/b597cff2-38e8-4e6e-999d-000002173027?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/security_groups/2d364f0a-a870-42c3-a554-000001099037/rules/b597cff2-38e8-4e6e-999d-000002173027?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3754,7 +3826,7 @@ def test_list_ike_policies "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3771,7 +3843,7 @@ def test_create_ike_policy "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3792,7 +3864,7 @@ def test_delete_ike_policy "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_ike_policy( id: "53ebcf53-2ee4-4a26-ba2c-afc62091a148" @@ -3806,7 +3878,7 @@ def test_get_ike_policy "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3825,7 +3897,7 @@ def test_update_ike_policy "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3844,7 +3916,7 @@ def test_list_ike_policy_connections "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148/connections?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/53ebcf53-2ee4-4a26-ba2c-afc62091a148/connections?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3863,7 +3935,7 @@ def test_list_ipsec_policies "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3880,7 +3952,7 @@ def test_create_ipsec_policy "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3900,7 +3972,7 @@ def test_delete_ipsec_policy "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_ipsec_policy( id: "43c2f663-3960-4289-9253-f6eab23a6cd7" @@ -3914,7 +3986,7 @@ def test_get_ipsec_policy "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3933,7 +4005,7 @@ def test_update_ipsec_policy "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3952,7 +4024,7 @@ def test_list_ipsec_policy_connections "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/43c2f663-3960-4289-9253-f6eab23a6cd7/connections?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3971,7 +4043,7 @@ def test_list_vpn_gateways "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -3988,7 +4060,7 @@ def test_create_vpn_gateway "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4006,7 +4078,7 @@ def test_delete_vpn_gateway "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_vpn_gateway( id: "e630bb38-c3a7-4619-b0e5-7bff14e060fe" @@ -4020,7 +4092,7 @@ def test_get_vpn_gateway "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4039,7 +4111,7 @@ def test_update_vpn_gateway "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4061,7 +4133,7 @@ def test_list_vpn_gateway_connections "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe/connections?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/e630bb38-c3a7-4619-b0e5-7bff14e060fe/connections?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4080,7 +4152,7 @@ def test_create_vpn_gateway_connection "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4099,7 +4171,7 @@ def test_delete_vpn_gateway_connection "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_vpn_gateway_connection( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4114,7 +4186,7 @@ def test_get_vpn_gateway_connection "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4134,7 +4206,7 @@ def test_update_vpn_gateway_connection "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4154,7 +4226,7 @@ def test_list_vpn_servers "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?sort=name&generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?sort=name&generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4187,7 +4259,7 @@ def test_create_vpn_server subnet_identity_model = { 'id': "970e8b78-8f09-4acf-b37a-30458bdfec96" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4208,7 +4280,7 @@ def test_get_vpn_server headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4226,7 +4298,7 @@ def test_update_vpn_server } vpn_server_patch_model = {} vpn_server_patch_model["name"] = "my-vpn-server-updated" - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4239,7 +4311,7 @@ def test_update_vpn_server end def test_delete_vpn_server - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95?generation=2&version=2022-09-13") .with( headers: { "Connection" => "close", @@ -4257,7 +4329,7 @@ def test_get_vpn_server_client_configuration # message_response = { "clients" => [{ "id" => "c74f8cc2-a174-4522-b057-7433e5f48833", "crn" => "crn:v1:staging:public:is:us-east:a/823bd195e9fd4f0db40ac2e1bffef3e0:71a3aeca-61ad-458f-99be-57c59ca0e60b::", "href" => "http://localhost:4000/rias-mock/us-east/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients/c74f8cc2-a174-4522-b057-7433e5f48833", "common_name" => "www.mock-certificate51610.com", "client_ip" => { "address" => "192.103.208.190" }, "data_received" => 41_053, "data_sent" => 28_914, "disconnected_at" => "", "created_at" => "2022-07-26T06:23:50.434Z", "remote_ip" => { "address" => "9.111.1.1" }, "remote_port" => 27_872, "resource_type" => "vpn_server_client", "status" => "connected" }, { "id" => "4750e2a7-a314-40f0-b659-ca69ad55dc57", "crn" => "crn:v1:staging:public:is:us-east:a/823bd195e9fd4f0db40ac2e1bffef3e0:b1213d1a-5f9d-437f-ab03-1f7a37654cb2::", "href" => "http://localhost:4000/rias-mock/us-east/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients/4750e2a7-a314-40f0-b659-ca69ad55dc57", "common_name" => "www.mock-certificate56773.com", "client_ip" => { "address" => "192.200.244.138" }, "data_received" => 26_558, "data_sent" => 53_975, "disconnected_at" => "2022-07-26T06:23:50.434Z", "created_at" => "2022-07-26T06:23:50.434Z", "remote_ip" => { "address" => "9.111.1.1" }, "remote_port" => 13_623, "resource_type" => "vpn_server_client", "status" => "disconnected" }], "limit" => 10, "first" => { "href" => "http://localhost:4000/rias-mock/us-east/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients?limit=10" } } message_response = "Mock data of vpn server client configuration..." - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/client_configuration?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/client_configuration?generation=2&version=2022-09-13") .with( headers: { "Connection" => "close", @@ -4277,7 +4349,7 @@ def test_list_vpn_server_clients headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients?sort=created_at&generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients?sort=created_at&generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4294,7 +4366,7 @@ def test_get_vpn_server_client headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients/c50e2258-c3fd-4151-b422-40a2db4d752c?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients/c50e2258-c3fd-4151-b422-40a2db4d752c?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4307,7 +4379,7 @@ def test_get_vpn_server_client end def test_disconnect_vpn_client - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients/c50e2258-c3fd-4151-b422-40a2db4d752c/disconnect?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/clients/c50e2258-c3fd-4151-b422-40a2db4d752c/disconnect?generation=2&version=2022-09-13") .with( headers: { "Connection" => "close", @@ -4327,7 +4399,7 @@ def test_list_vpn_server_routes headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4343,7 +4415,7 @@ def test_create_vpn_server_route headers = { "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4361,7 +4433,7 @@ def test_get_vpn_server_route headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/5e57b6f6-3a07-4417-a3bb-fed686a0bd0b?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/5e57b6f6-3a07-4417-a3bb-fed686a0bd0b?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4380,7 +4452,7 @@ def test_update_vpn_server_route } vpn_server_route_patch_model = {} vpn_server_route_patch_model["name"] = "my-vpnserver-route-updated" - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/5e57b6f6-3a07-4417-a3bb-fed686a0bd0b?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/5e57b6f6-3a07-4417-a3bb-fed686a0bd0b?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4394,7 +4466,7 @@ def test_update_vpn_server_route end def test_delete_vpn_server_route - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/5e57b6f6-3a07-4417-a3bb-fed686a0bd0b?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/5e57b6f6-3a07-4417-a3bb-fed686a0bd0b?generation=2&version=2022-09-13") .with( headers: { "Connection" => "close", @@ -4410,7 +4482,7 @@ def test_delete_vpn_server_route end def test_delete_vpn_server_client - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/c50e2258-c3fd-4151-b422-40a2db4d752c?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/970e8b78-8f09-4acf-b37a-30458bdfec95/routes/c50e2258-c3fd-4151-b422-40a2db4d752c?generation=2&version=2022-09-13") .with( headers: { "Connection" => "close", @@ -4431,7 +4503,7 @@ def test_list_backup_policies "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4459,7 +4531,7 @@ def test_create_backup_policy 'name': "my-backup-policy-plan" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4478,7 +4550,7 @@ def test_list_backup_policy_plans headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4498,7 +4570,7 @@ def test_create_backup_policy_plan 'delete_after': 20, 'delete_over_count': 20 } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4520,7 +4592,7 @@ def test_get_backup_policy_plan headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4539,7 +4611,7 @@ def test_update_backup_policy_plan } backup_policy_plan_patch_model = {} backup_policy_plan_patch_model["name"] = "my-backup-policy-plan-updated" - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4552,12 +4624,47 @@ def test_update_backup_policy_plan assert_equal(message_response, service_response.result) end + def test_list_backup_policy_jobs + message_response = { "active" => true, "attach_user_tags" => ["my-daily-backup-plan"], "copy_user_tags" => true, "created_at" => "2022-06-15T11:48:01.147Z", "cron_spec" => "*/5 1,2,3 * * *", "deletion_trigger" => { "delete_after" => 20 }, "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06", "id" => "9eab386c-1d86-47fb-8d86-e0732ebcce06", "lifecycle_state" => "pending", "name" => "my-backup-policy-plan", "resource_type" => "backup_policy_plan" } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/jobs?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.list_backup_policy_jobs( + backup_policy_id: "d5b7008f-b3da-46d4-a499-d3c8368f0ce1" + ) + assert_equal(message_response, service_response.result) + end + + def test_get_backup_policy_job + message_response = { "active" => true, "attach_user_tags" => ["my-daily-backup-plan"], "copy_user_tags" => true, "created_at" => "2022-06-15T11:48:01.147Z", "cron_spec" => "*/5 1,2,3 * * *", "deletion_trigger" => { "delete_after" => 20 }, "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06", "id" => "9eab386c-1d86-47fb-8d86-e0732ebcce06", "lifecycle_state" => "pending", "name" => "my-backup-policy-plan", "resource_type" => "backup_policy_plan" } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/jobs/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.get_backup_policy_job( + backup_policy_id: "d5b7008f-b3da-46d4-a499-d3c8368f0ce1", + id: "9eab386c-1d86-47fb-8d86-e0732ebcce06" + ) + assert_equal(message_response, service_response.result) + end + def test_get_backup_policy message_response = { "created_at" => "2022-07-26T11:48:01.147Z", "last_job_completed_at" => "2022-07-19T11:48:01.147Z", "crn" => "crn:v1:staging:public:is:us-east:a/823bd195e9fd4f0db40ac2e1bffef3e0:349162a6-0c56-4dc6-97d2-0f54611fe415::", "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1", "id" => "d5b7008f-b3da-46d4-a499-d3c8368f0ce1", "lifecycle_state" => "pending", "match_resource_types" => ["volume"], "match_user_tags" => ["my-daily-backup-policy"], "name" => "my-backup-policy", "plans" => [{ "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06", "id" => "9eab386c-1d86-47fb-8d86-e0732ebcce06", "name" => "my-backup-policy-plan-updated", "resource_type" => "backup_policy_plan" }, { "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/8d0c8d7f-7b61-441d-9cd7-21acef0566bf", "id" => "8d0c8d7f-7b61-441d-9cd7-21acef0566bf", "name" => "my-backup-policy-plan", "resource_type" => "backup_policy" }], "resource_group" => { "name" => "SmokeTest", "id" => "720a9c5878c7403ba80573f717ecf9b0" }, "resource_type" => "backup_policy", "status" => "stable" } headers = { "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4575,7 +4682,7 @@ def test_update_backup_policy } backup_policy_patch_model = {} backup_policy_patch_model["name"] = "my-backup-policy-updated" - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4592,7 +4699,7 @@ def test_delete_backup_policy_plan headers = { "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4610,7 +4717,7 @@ def test_delete_backup_policy headers = { "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4622,6 +4729,43 @@ def test_delete_backup_policy assert_equal(message_response, service_response.result) end + def test_list_bare_metal_server_network_interface_ips + message_response = { "created_at" => "2022-07-26T11:48:01.147Z", "last_job_completed_at" => "2022-07-19T11:48:01.147Z", "crn" => "crn:v1:staging:public:is:us-east:a/823bd195e9fd4f0db40ac2e1bffef3e0:349162a6-0c56-4dc6-97d2-0f54611fe415::", "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1", "id" => "d5b7008f-b3da-46d4-a499-d3c8368f0ce1", "lifecycle_state" => "pending", "match_resource_types" => ["volume"], "match_user_tags" => ["my-daily-backup-policy"], "name" => "my-backup-policy-updated", "plans" => [{ "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06", "id" => "9eab386c-1d86-47fb-8d86-e0732ebcce06", "name" => "my-backup-policy-plan-updated", "resource_type" => "backup_policy_plan" }, { "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/8d0c8d7f-7b61-441d-9cd7-21acef0566bf", "id" => "8d0c8d7f-7b61-441d-9cd7-21acef0566bf", "name" => "my-backup-policy-plan", "resource_type" => "backup_policy" }], "resource_group" => { "name" => "SmokeTest", "id" => "720a9c5878c7403ba80573f717ecf9b0" }, "resource_type" => "backup_policy", "status" => "stable" } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/network_interfaces/9eab386c-1d86-47fb-8d86-e0732ebcce06/ips?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.list_bare_metal_server_network_interface_ips( + bare_metal_server_id: "d5b7008f-b3da-46d4-a499-d3c8368f0ce1", + network_interface_id: "9eab386c-1d86-47fb-8d86-e0732ebcce06" + ) + assert_equal(message_response, service_response.result) + end + + def test_get_bare_metal_server_network_interface_ip + message_response = { "created_at" => "2022-07-26T11:48:01.147Z", "last_job_completed_at" => "2022-07-19T11:48:01.147Z", "crn" => "crn:v1:staging:public:is:us-east:a/823bd195e9fd4f0db40ac2e1bffef3e0:349162a6-0c56-4dc6-97d2-0f54611fe415::", "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1", "id" => "d5b7008f-b3da-46d4-a499-d3c8368f0ce1", "lifecycle_state" => "pending", "match_resource_types" => ["volume"], "match_user_tags" => ["my-daily-backup-policy"], "name" => "my-backup-policy-updated", "plans" => [{ "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/9eab386c-1d86-47fb-8d86-e0732ebcce06", "id" => "9eab386c-1d86-47fb-8d86-e0732ebcce06", "name" => "my-backup-policy-plan-updated", "resource_type" => "backup_policy_plan" }, { "href" => "http://localhost:4000/rias-mock/us-east/v1/backup_policies/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/plans/8d0c8d7f-7b61-441d-9cd7-21acef0566bf", "id" => "8d0c8d7f-7b61-441d-9cd7-21acef0566bf", "name" => "my-backup-policy-plan", "resource_type" => "backup_policy" }], "resource_group" => { "name" => "SmokeTest", "id" => "720a9c5878c7403ba80573f717ecf9b0" }, "resource_type" => "backup_policy", "status" => "stable" } + headers = { + "Content-Type" => "application/json" + } + + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/d5b7008f-b3da-46d4-a499-d3c8368f0ce1/network_interfaces/9eab386c-1d86-47fb-8d86-e0732ebcce06/ips/9eab386c-1d86-47fb-8d86-ihba-dhb87a7d?generation=2&version=2022-09-13") + .with( + headers: { "Accept" => "application/json" } + ) + .to_return(status: 200, body: message_response.to_json, headers: headers) + service_response = service.get_bare_metal_server_network_interface_ip( + bare_metal_server_id: "d5b7008f-b3da-46d4-a499-d3c8368f0ce1", + network_interface_id: "9eab386c-1d86-47fb-8d86-e0732ebcce06", + id: "9eab386c-1d86-47fb-8d86-ihba-dhb87a7d" + ) + assert_equal(message_response, service_response.result) + end + def test_list_vpn_gateway_connection_local_cidrs message_response = { "local_cidrs" => [ @@ -4632,7 +4776,7 @@ def test_list_vpn_gateway_connection_local_cidrs "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4651,7 +4795,7 @@ def test_remove_vpn_gateway_connection_local_cidr "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs/0.0.19.0/24?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs/0.0.19.0/24?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.remove_vpn_gateway_connection_local_cidr( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4671,7 +4815,7 @@ def test_check_vpn_gateway_connection_local_cidr "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs/0.0.19.0/24?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs/0.0.19.0/24?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.check_vpn_gateway_connection_local_cidr( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4691,7 +4835,7 @@ def test_add_vpn_gateway_connection_local_cidr "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs/0.0.19.0/24?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/local_cidrs/0.0.19.0/24?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.add_vpn_gateway_connection_local_cidr( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4711,7 +4855,7 @@ def test_list_vpn_gateway_connection_peer_cidrs "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4730,7 +4874,7 @@ def test_remove_vpn_gateway_connection_peer_cidr "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs/0.0.150.0/24?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs/0.0.150.0/24?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.remove_vpn_gateway_connection_peer_cidr( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4746,7 +4890,7 @@ def test_check_vpn_gateway_connection_peer_cidr "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs/0.0.150.0/24?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs/0.0.150.0/24?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.check_vpn_gateway_connection_peer_cidr( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4762,7 +4906,7 @@ def test_add_vpn_gateway_connection_peer_cidr "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs/0.0.150.0/24?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/a7d258d5-be1e-491d-83db-526d8d9a2ce9/connections/b67efb2c-bd17-457d-be8e-7b46404062dc/peer_cidrs/0.0.150.0/24?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.add_vpn_gateway_connection_peer_cidr( vpn_gateway_id: "a7d258d5-be1e-491d-83db-526d8d9a2ce9", @@ -4779,7 +4923,7 @@ def test_list_load_balancer_profiles "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4796,7 +4940,7 @@ def test_get_load_balancer_profile "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4817,7 +4961,7 @@ def test_list_load_balancers "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4834,7 +4978,7 @@ def test_create_load_balancer "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4860,7 +5004,7 @@ def test_delete_load_balancer "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_load_balancer( id: "7b6dc78d-49f3-435f-b767-e05f9affd3ca" @@ -4874,7 +5018,7 @@ def test_get_load_balancer "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4893,7 +5037,7 @@ def test_update_load_balancer "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4917,7 +5061,7 @@ def test_get_load_balancer_statistics "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca/statistics?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/7b6dc78d-49f3-435f-b767-e05f9affd3ca/statistics?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4938,7 +5082,7 @@ def test_list_load_balancer_listeners "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4957,7 +5101,7 @@ def test_create_load_balancer_listener "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -4977,7 +5121,7 @@ def test_delete_load_balancer_listener "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_load_balancer_listener( load_balancer_id: "2c791a20-4109-4484-894a-09f332753169", @@ -4992,7 +5136,7 @@ def test_get_load_balancer_listener "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5012,7 +5156,7 @@ def test_update_load_balancer_listener "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5032,7 +5176,7 @@ def test_list_load_balancer_listener_policies "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5051,7 +5195,7 @@ def test_create_load_balancer_listener_policy "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5072,7 +5216,7 @@ def test_delete_load_balancer_listener_policy "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_load_balancer_listener_policy( load_balancer_id: "2c791a20-4109-4484-894a-09f332753169", @@ -5087,7 +5231,7 @@ def test_get_load_balancer_listener_policy "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5107,7 +5251,7 @@ def test_update_load_balancer_listener_policy "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5128,7 +5272,7 @@ def test_list_load_balancer_listener_policy_rules "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5148,7 +5292,7 @@ def test_create_load_balancer_listener_policy_rule "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5171,7 +5315,7 @@ def test_delete_load_balancer_listener_policy_rule "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules/b2f46c0b-4dd6-4881-9d53-a2a6581ac43b?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules/b2f46c0b-4dd6-4881-9d53-a2a6581ac43b?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_load_balancer_listener_policy_rule( load_balancer_id: "2c791a20-4109-4484-894a-09f332753169", @@ -5187,7 +5331,7 @@ def test_get_load_balancer_listener_policy_rule "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules/b2f46c0b-4dd6-4881-9d53-a2a6581ac43b?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules/b2f46c0b-4dd6-4881-9d53-a2a6581ac43b?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5208,7 +5352,7 @@ def test_update_load_balancer_listener_policy_rule "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules/b2f46c0b-4dd6-4881-9d53-a2a6581ac43b?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/listeners/f5ceb28b-f448-4a5e-8d9d-ec81714f20bd/policies/47d4c9f2-8e41-433d-a095-2287efe4b8ae/rules/b2f46c0b-4dd6-4881-9d53-a2a6581ac43b?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5233,7 +5377,7 @@ def test_list_load_balancer_pools "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5252,7 +5396,7 @@ def test_create_load_balancer_pool "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109­4484-894a-09f332753169/pools?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109­4484-894a-09f332753169/pools?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5279,7 +5423,7 @@ def test_delete_load_balancer_pool "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/64d1a65c-d759-4e87-9dc5-ff570d41e4b6/pools/528c70d0-acc1-47c7-a32d-698c350f4f81?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/64d1a65c-d759-4e87-9dc5-ff570d41e4b6/pools/528c70d0-acc1-47c7-a32d-698c350f4f81?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_load_balancer_pool( load_balancer_id: "64d1a65c-d759-4e87-9dc5-ff570d41e4b6", @@ -5294,7 +5438,7 @@ def test_get_load_balancer_pool "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/64d1a65c-d759-4e87-9dc5-ff570d41e4b6/pools/528c70d0-acc1-47c7-a32d-698c350f4f81?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/64d1a65c-d759-4e87-9dc5-ff570d41e4b6/pools/528c70d0-acc1-47c7-a32d-698c350f4f81?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5314,7 +5458,7 @@ def test_update_load_balancer_pool "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/64d1a65c-d759-4e87-9dc5-ff570d41e4b6/pools/528c70d0-acc1-47c7-a32d-698c350f4f81?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/64d1a65c-d759-4e87-9dc5-ff570d41e4b6/pools/528c70d0-acc1-47c7-a32d-698c350f4f81?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5357,7 +5501,7 @@ def test_list_load_balancer_pool_members "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5385,7 +5529,7 @@ def test_create_load_balancer_pool_member "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5406,7 +5550,7 @@ def test_replace_load_balancer_pool_members "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5447,7 +5591,7 @@ def test_delete_load_balancer_pool_member "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members/daebeb48-1658-4772-8ca9-e410cd6e1415?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members/daebeb48-1658-4772-8ca9-e410cd6e1415?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.delete_load_balancer_pool_member( load_balancer_id: "2c791a20-4109-4484-894a-09f332753169", @@ -5471,7 +5615,7 @@ def test_get_load_balancer_pool_member "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members/daebeb48-1658-4772-8ca9-e410cd6e1415?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members/daebeb48-1658-4772-8ca9-e410cd6e1415?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5500,7 +5644,7 @@ def test_update_load_balancer_pool_member "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members/daebeb48-1658-4772-8ca9-e410cd6e1415?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/2c791a20-4109-4484-894a-09f332753169/pools/54ad563a-0261-11e9-8317-bec54e704988/members/daebeb48-1658-4772-8ca9-e410cd6e1415?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5526,7 +5670,7 @@ def test_list_endpoint_gateways "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5543,7 +5687,7 @@ def test_create_endpoint_gateway "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5570,7 +5714,7 @@ def test_list_endpoint_gateway_ips "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5588,7 +5732,7 @@ def test_remove_endpoint_gateway_ip "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips/0716-9faf2f32-8528-4180-a14d-c1f6c5c83292?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips/0716-9faf2f32-8528-4180-a14d-c1f6c5c83292?generation=2&version=2022-09-13") .to_return(status: 204, body: message_response.to_json, headers: headers) service.remove_endpoint_gateway_ip( endpoint_gateway_id: "r134-a4841334-b584-4293-938e-3bc63b4a5b6a", @@ -5618,7 +5762,7 @@ def test_get_endpoint_gateway_ip "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips/0716-9faf2f32-8528-4180-a14d-c1f6c5c83292?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips/0716-9faf2f32-8528-4180-a14d-c1f6c5c83292?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5637,7 +5781,7 @@ def test_add_endpoint_gateway_ip "Content-Type" => "application/json" } - stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips/0716-9faf2f32-8528-4180-a14d-c1f6c5c83292?generation=2&version=2022-03-29") + stub_request(:put, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a/ips/0716-9faf2f32-8528-4180-a14d-c1f6c5c83292?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5656,7 +5800,7 @@ def test_delete_endpoint_gateway "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.delete_endpoint_gateway( id: "r134-a4841334-b584-4293-938e-3bc63b4a5b6a" @@ -5670,7 +5814,7 @@ def test_get_endpoint_gateway "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5689,7 +5833,7 @@ def test_update_endpoint_gateway "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-a4841334-b584-4293-938e-3bc63b4a5b6a?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5709,7 +5853,7 @@ def test_list_flow_log_collectors "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5726,7 +5870,7 @@ def test_create_flow_log_collector "Content-Type" => "application/json" } - stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?generation=2&version=2022-03-29") + stub_request(:post, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5754,7 +5898,7 @@ def test_delete_flow_log_collector "Content-Type" => "application/json" } - stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/4dd1852a-3373-46c0-9240-f9c7f0d0c1a3?generation=2&version=2022-03-29") + stub_request(:delete, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/4dd1852a-3373-46c0-9240-f9c7f0d0c1a3?generation=2&version=2022-09-13") .to_return(status: 200, body: message_response.to_json, headers: headers) service.delete_flow_log_collector( id: "4dd1852a-3373-46c0-9240-f9c7f0d0c1a3" @@ -5768,7 +5912,7 @@ def test_get_flow_log_collector "Content-Type" => "application/json" } - stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/4dd1852a-3373-46c0-9240-f9c7f0d0c1a3?generation=2&version=2022-03-29") + stub_request(:get, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/4dd1852a-3373-46c0-9240-f9c7f0d0c1a3?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } ) @@ -5787,7 +5931,7 @@ def test_update_flow_log_collector "Content-Type" => "application/json" } - stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/4dd1852a-3373-46c0-9240-f9c7f0d0c1a3?generation=2&version=2022-03-29") + stub_request(:patch, "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/4dd1852a-3373-46c0-9240-f9c7f0d0c1a3?generation=2&version=2022-09-13") .with( headers: { "Accept" => "application/json" } )