From 34d9716a64a1171cb81aa5c76de539ced6ccdcdb Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Thu, 5 Sep 2024 10:23:08 -0500 Subject: [PATCH] regenerate code from updated spec --- equinix/services/metalv1/__init__.py | 3 - .../InstancesBatchCreateInputBatchesInner.md | 4 +- ...tancesBatchCreateInputBatchesInnerAllOf.md | 31 ----- .../services/metalv1/docs/Interconnection.md | 2 +- .../metalv1/docs/InterconnectionMetro.md | 34 ------ ...nterconnectionMetroListMetrosInnerAllOf.md | 30 ----- equinix/services/metalv1/models/__init__.py | 3 - ...tances_batch_create_input_batches_inner.py | 6 +- ...batch_create_input_batches_inner_all_of.py | 105 ----------------- .../metalv1/models/interconnection.py | 6 +- .../metalv1/models/interconnection_metro.py | 109 ----------------- ...nnection_metro_list_metros_inner_all_of.py | 111 ------------------ ...tances_batch_create_input_batches_inner.py | 2 +- ...batch_create_input_batches_inner_all_of.py | 56 --------- .../metalv1/test/test_interconnection.py | 7 +- .../test/test_interconnection_metro.py | 56 --------- ...nnection_metro_list_metros_inner_all_of.py | 67 ----------- equinix/services/metalv1_README.md | 3 - 18 files changed, 16 insertions(+), 619 deletions(-) delete mode 100644 equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInnerAllOf.md delete mode 100644 equinix/services/metalv1/docs/InterconnectionMetro.md delete mode 100644 equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOf.md delete mode 100644 equinix/services/metalv1/models/instances_batch_create_input_batches_inner_all_of.py delete mode 100644 equinix/services/metalv1/models/interconnection_metro.py delete mode 100644 equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of.py delete mode 100644 equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner_all_of.py delete mode 100644 equinix/services/metalv1/test/test_interconnection_metro.py delete mode 100644 equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner_all_of.py diff --git a/equinix/services/metalv1/__init__.py b/equinix/services/metalv1/__init__.py index cb86506a..ca24adb1 100644 --- a/equinix/services/metalv1/__init__.py +++ b/equinix/services/metalv1/__init__.py @@ -164,14 +164,11 @@ from equinix.services.metalv1.models.ip_reservation_request_input import IPReservationRequestInput from equinix.services.metalv1.models.instances_batch_create_input import InstancesBatchCreateInput from equinix.services.metalv1.models.instances_batch_create_input_batches_inner import InstancesBatchCreateInputBatchesInner -from equinix.services.metalv1.models.instances_batch_create_input_batches_inner_all_of import InstancesBatchCreateInputBatchesInnerAllOf from equinix.services.metalv1.models.interconnection import Interconnection from equinix.services.metalv1.models.interconnection_fabric_provider import InterconnectionFabricProvider from equinix.services.metalv1.models.interconnection_list import InterconnectionList -from equinix.services.metalv1.models.interconnection_metro import InterconnectionMetro from equinix.services.metalv1.models.interconnection_metro_list import InterconnectionMetroList from equinix.services.metalv1.models.interconnection_metro_list_metros_inner import InterconnectionMetroListMetrosInner -from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of import InterconnectionMetroListMetrosInnerAllOf from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner from equinix.services.metalv1.models.interconnection_port import InterconnectionPort from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList diff --git a/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md b/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md index 34ec4e2d..d50cca21 100644 --- a/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md +++ b/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hostnames** | **List[str]** | | [optional] -**href** | **str** | | [optional] **quantity** | **int** | The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. | [optional] +**href** | **str** | | [optional] **metro** | **str** | Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided. | **always_pxe** | **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] **billing_cycle** | **str** | The billing cycle of the device. | [optional] @@ -16,7 +16,7 @@ Name | Type | Description | Notes **features** | **List[str]** | The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. | [optional] **hardware_reservation_id** | **str** | The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://deploy.equinix.com/developers/docs/metal/deploy/reserved/) for more details. | [optional] **hostname** | **str** | The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. | [optional] -**ip_addresses** | [**List[IPAddress]**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{address_family=4, public=true}, {address_family=4, public=false}, {address_family=6, public=true}]] +**ip_addresses** | [**List[IPAddress]**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{"address_family":4,"public":true},{"address_family":4,"public":false},{"address_family":6,"public":true}]] **ipxe_script_url** | **str** | When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://deploy.equinix.com/developers/docs/metal/operating-systems/custom-ipxe/) for more details. | [optional] **locked** | **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] [default to False] **network_frozen** | **bool** | If true, this instance can not be converted to a different network type. | [optional] diff --git a/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInnerAllOf.md b/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInnerAllOf.md deleted file mode 100644 index 0aa0fcc8..00000000 --- a/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInnerAllOf.md +++ /dev/null @@ -1,31 +0,0 @@ -# InstancesBatchCreateInputBatchesInnerAllOf - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hostnames** | **List[str]** | | [optional] -**href** | **str** | | [optional] -**quantity** | **int** | The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. | [optional] - -## Example - -```python -from equinix.services.metalv1.models.instances_batch_create_input_batches_inner_all_of import InstancesBatchCreateInputBatchesInnerAllOf - -# TODO update the JSON string below -json = "{}" -# create an instance of InstancesBatchCreateInputBatchesInnerAllOf from a JSON string -instances_batch_create_input_batches_inner_all_of_instance = InstancesBatchCreateInputBatchesInnerAllOf.from_json(json) -# print the JSON string representation of the object -print(InstancesBatchCreateInputBatchesInnerAllOf.to_json()) - -# convert the object into a dict -instances_batch_create_input_batches_inner_all_of_dict = instances_batch_create_input_batches_inner_all_of_instance.to_dict() -# create an instance of InstancesBatchCreateInputBatchesInnerAllOf from a dict -instances_batch_create_input_batches_inner_all_of_form_dict = instances_batch_create_input_batches_inner_all_of.from_dict(instances_batch_create_input_batches_inner_all_of_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/equinix/services/metalv1/docs/Interconnection.md b/equinix/services/metalv1/docs/Interconnection.md index ac6ae16e..bfdb9f22 100644 --- a/equinix/services/metalv1/docs/Interconnection.md +++ b/equinix/services/metalv1/docs/Interconnection.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **facility** | [**Facility**](Facility.md) | | [optional] **href** | **str** | | [optional] **id** | **str** | | [optional] -**metro** | [**InterconnectionMetro**](InterconnectionMetro.md) | | [optional] +**metro** | [**Metro**](Metro.md) | The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | [optional] **mode** | **str** | The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. | [optional] **name** | **str** | | [optional] **organization** | [**Organization**](Organization.md) | | [optional] diff --git a/equinix/services/metalv1/docs/InterconnectionMetro.md b/equinix/services/metalv1/docs/InterconnectionMetro.md deleted file mode 100644 index 01b7b409..00000000 --- a/equinix/services/metalv1/docs/InterconnectionMetro.md +++ /dev/null @@ -1,34 +0,0 @@ -# InterconnectionMetro - -The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **str** | | [optional] -**country** | **str** | | [optional] -**href** | **str** | | [optional] -**id** | **str** | | [optional] -**name** | **str** | | [optional] - -## Example - -```python -from equinix.services.metalv1.models.interconnection_metro import InterconnectionMetro - -# TODO update the JSON string below -json = "{}" -# create an instance of InterconnectionMetro from a JSON string -interconnection_metro_instance = InterconnectionMetro.from_json(json) -# print the JSON string representation of the object -print(InterconnectionMetro.to_json()) - -# convert the object into a dict -interconnection_metro_dict = interconnection_metro_instance.to_dict() -# create an instance of InterconnectionMetro from a dict -interconnection_metro_form_dict = interconnection_metro.from_dict(interconnection_metro_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOf.md b/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOf.md deleted file mode 100644 index 881cbaab..00000000 --- a/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# InterconnectionMetroListMetrosInnerAllOf - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **str** | | [optional] -**providers** | [**List[InterconnectionMetroListMetrosInnerAllOfProvidersInner]**](InterconnectionMetroListMetrosInnerAllOfProvidersInner.md) | A list of providers and their equivalent regions available for connecting to the provider network. | [optional] - -## Example - -```python -from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of import InterconnectionMetroListMetrosInnerAllOf - -# TODO update the JSON string below -json = "{}" -# create an instance of InterconnectionMetroListMetrosInnerAllOf from a JSON string -interconnection_metro_list_metros_inner_all_of_instance = InterconnectionMetroListMetrosInnerAllOf.from_json(json) -# print the JSON string representation of the object -print(InterconnectionMetroListMetrosInnerAllOf.to_json()) - -# convert the object into a dict -interconnection_metro_list_metros_inner_all_of_dict = interconnection_metro_list_metros_inner_all_of_instance.to_dict() -# create an instance of InterconnectionMetroListMetrosInnerAllOf from a dict -interconnection_metro_list_metros_inner_all_of_form_dict = interconnection_metro_list_metros_inner_all_of.from_dict(interconnection_metro_list_metros_inner_all_of_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/equinix/services/metalv1/models/__init__.py b/equinix/services/metalv1/models/__init__.py index 4150e873..b851eeba 100644 --- a/equinix/services/metalv1/models/__init__.py +++ b/equinix/services/metalv1/models/__init__.py @@ -108,14 +108,11 @@ from equinix.services.metalv1.models.ip_reservation_request_input import IPReservationRequestInput from equinix.services.metalv1.models.instances_batch_create_input import InstancesBatchCreateInput from equinix.services.metalv1.models.instances_batch_create_input_batches_inner import InstancesBatchCreateInputBatchesInner -from equinix.services.metalv1.models.instances_batch_create_input_batches_inner_all_of import InstancesBatchCreateInputBatchesInnerAllOf from equinix.services.metalv1.models.interconnection import Interconnection from equinix.services.metalv1.models.interconnection_fabric_provider import InterconnectionFabricProvider from equinix.services.metalv1.models.interconnection_list import InterconnectionList -from equinix.services.metalv1.models.interconnection_metro import InterconnectionMetro from equinix.services.metalv1.models.interconnection_metro_list import InterconnectionMetroList from equinix.services.metalv1.models.interconnection_metro_list_metros_inner import InterconnectionMetroListMetrosInner -from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of import InterconnectionMetroListMetrosInnerAllOf from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner from equinix.services.metalv1.models.interconnection_port import InterconnectionPort from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList diff --git a/equinix/services/metalv1/models/instances_batch_create_input_batches_inner.py b/equinix/services/metalv1/models/instances_batch_create_input_batches_inner.py index 67eadcb7..26585790 100644 --- a/equinix/services/metalv1/models/instances_batch_create_input_batches_inner.py +++ b/equinix/services/metalv1/models/instances_batch_create_input_batches_inner.py @@ -33,8 +33,8 @@ class InstancesBatchCreateInputBatchesInner(BaseModel): InstancesBatchCreateInputBatchesInner """ # noqa: E501 hostnames: Optional[List[StrictStr]] = None - href: Optional[StrictStr] = None quantity: Optional[StrictInt] = Field(default=None, description="The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on.") + href: Optional[StrictStr] = None metro: StrictStr = Field(description="Metro code or ID of where the device should be provisioned in, or it can be instructed to create the device in the best available metro with `{ \"metro\": \"any\" }`. The special metro value of any means anywhere, any metro. When any is chosen in the request, the metro location is picked per our scheduling algorithms that favor the following factors: hardware reservation location (if requesting reserved hardware), ip reservations, spot instances, etc. The any keyword *does not* optimize for cost, this means that usage costs (instance, transfer, other features dependent on location) will vary. Please check metro value in response to see where the device was created. Either metro or facility must be provided.") always_pxe: Optional[StrictBool] = Field(default=None, description="When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot.") billing_cycle: Optional[StrictStr] = Field(default=None, description="The billing cycle of the device.") @@ -63,7 +63,7 @@ class InstancesBatchCreateInputBatchesInner(BaseModel): userdata: Optional[StrictStr] = Field(default=None, description="The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://deploy.equinix.com/developers/docs/metal/server-metadata/user-data/) and [Provisioning with Custom iPXE](https://deploy.equinix.com/developers/docs/metal/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details.") facility: FacilityInputFacility additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["hostnames", "href", "quantity", "metro", "always_pxe", "billing_cycle", "customdata", "description", "features", "hardware_reservation_id", "hostname", "ip_addresses", "ipxe_script_url", "locked", "network_frozen", "no_ssh_keys", "operating_system", "plan", "private_ipv4_subnet_size", "project_ssh_keys", "public_ipv4_subnet_size", "spot_instance", "spot_price_max", "ssh_keys", "storage", "tags", "termination_time", "user_ssh_keys", "userdata", "facility"] + __properties: ClassVar[List[str]] = ["hostnames", "quantity", "href", "metro", "always_pxe", "billing_cycle", "customdata", "description", "features", "hardware_reservation_id", "hostname", "ip_addresses", "ipxe_script_url", "locked", "network_frozen", "no_ssh_keys", "operating_system", "plan", "private_ipv4_subnet_size", "project_ssh_keys", "public_ipv4_subnet_size", "spot_instance", "spot_price_max", "ssh_keys", "storage", "tags", "termination_time", "user_ssh_keys", "userdata", "facility"] @field_validator('billing_cycle') def billing_cycle_validate_enum(cls, value): @@ -154,8 +154,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "hostnames": obj.get("hostnames"), - "href": obj.get("href"), "quantity": obj.get("quantity"), + "href": obj.get("href"), "metro": obj.get("metro"), "always_pxe": obj.get("always_pxe"), "billing_cycle": obj.get("billing_cycle"), diff --git a/equinix/services/metalv1/models/instances_batch_create_input_batches_inner_all_of.py b/equinix/services/metalv1/models/instances_batch_create_input_batches_inner_all_of.py deleted file mode 100644 index 8b78bdd1..00000000 --- a/equinix/services/metalv1/models/instances_batch_create_input_batches_inner_all_of.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class InstancesBatchCreateInputBatchesInnerAllOf(BaseModel): - """ - InstancesBatchCreateInputBatchesInnerAllOf - """ # noqa: E501 - hostnames: Optional[List[StrictStr]] = None - href: Optional[StrictStr] = None - quantity: Optional[StrictInt] = Field(default=None, description="The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["hostnames", "href", "quantity"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstancesBatchCreateInputBatchesInnerAllOf from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstancesBatchCreateInputBatchesInnerAllOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hostnames": obj.get("hostnames"), - "href": obj.get("href"), - "quantity": obj.get("quantity") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/equinix/services/metalv1/models/interconnection.py b/equinix/services/metalv1/models/interconnection.py index 8c3e2c89..32d6fe9a 100644 --- a/equinix/services/metalv1/models/interconnection.py +++ b/equinix/services/metalv1/models/interconnection.py @@ -25,8 +25,8 @@ from equinix.services.metalv1.models.facility import Facility from equinix.services.metalv1.models.href import Href from equinix.services.metalv1.models.interconnection_fabric_provider import InterconnectionFabricProvider -from equinix.services.metalv1.models.interconnection_metro import InterconnectionMetro from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from equinix.services.metalv1.models.metro import Metro from equinix.services.metalv1.models.organization import Organization from equinix.services.metalv1.models.project import Project from typing import Optional, Set @@ -44,7 +44,7 @@ class Interconnection(BaseModel): facility: Optional[Facility] = None href: Optional[StrictStr] = None id: Optional[StrictStr] = None - metro: Optional[InterconnectionMetro] = None + metro: Optional[Metro] = Field(default=None, description="The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here.") mode: Optional[StrictStr] = Field(default=None, description="The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances.") name: Optional[StrictStr] = None organization: Optional[Organization] = None @@ -190,7 +190,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "facility": Facility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, "href": obj.get("href"), "id": obj.get("id"), - "metro": InterconnectionMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "metro": Metro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, "mode": obj.get("mode"), "name": obj.get("name"), "organization": Organization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, diff --git a/equinix/services/metalv1/models/interconnection_metro.py b/equinix/services/metalv1/models/interconnection_metro.py deleted file mode 100644 index a4abf33f..00000000 --- a/equinix/services/metalv1/models/interconnection_metro.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class InterconnectionMetro(BaseModel): - """ - The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. - """ # noqa: E501 - code: Optional[StrictStr] = None - country: Optional[StrictStr] = None - href: Optional[StrictStr] = None - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "country", "href", "id", "name"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InterconnectionMetro from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InterconnectionMetro from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "country": obj.get("country"), - "href": obj.get("href"), - "id": obj.get("id"), - "name": obj.get("name") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of.py b/equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of.py deleted file mode 100644 index 095237fe..00000000 --- a/equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner -from typing import Optional, Set -from typing_extensions import Self - -class InterconnectionMetroListMetrosInnerAllOf(BaseModel): - """ - InterconnectionMetroListMetrosInnerAllOf - """ # noqa: E501 - href: Optional[StrictStr] = None - providers: Optional[List[InterconnectionMetroListMetrosInnerAllOfProvidersInner]] = Field(default=None, description="A list of providers and their equivalent regions available for connecting to the provider network.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["href", "providers"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InterconnectionMetroListMetrosInnerAllOf from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in providers (list) - _items = [] - if self.providers: - for _item in self.providers: - if _item: - _items.append(_item.to_dict()) - _dict['providers'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InterconnectionMetroListMetrosInnerAllOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "href": obj.get("href"), - "providers": [InterconnectionMetroListMetrosInnerAllOfProvidersInner.from_dict(_item) for _item in obj["providers"]] if obj.get("providers") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner.py b/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner.py index 02d60b48..cb809cfa 100644 --- a/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner.py +++ b/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner.py @@ -39,8 +39,8 @@ def make_instance(self, include_optional) -> InstancesBatchCreateInputBatchesInn hostnames = [ '' ], - href = '', quantity = 56, + href = '', metro = 'sv', always_pxe = True, billing_cycle = 'hourly', diff --git a/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner_all_of.py b/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner_all_of.py deleted file mode 100644 index d8d86137..00000000 --- a/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner_all_of.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from equinix.services.metalv1.models.instances_batch_create_input_batches_inner_all_of import InstancesBatchCreateInputBatchesInnerAllOf - -class TestInstancesBatchCreateInputBatchesInnerAllOf(unittest.TestCase): - """InstancesBatchCreateInputBatchesInnerAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> InstancesBatchCreateInputBatchesInnerAllOf: - """Test InstancesBatchCreateInputBatchesInnerAllOf - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InstancesBatchCreateInputBatchesInnerAllOf` - """ - model = InstancesBatchCreateInputBatchesInnerAllOf() - if include_optional: - return InstancesBatchCreateInputBatchesInnerAllOf( - hostnames = [ - '' - ], - href = '', - quantity = 56 - ) - else: - return InstancesBatchCreateInputBatchesInnerAllOf( - ) - """ - - def testInstancesBatchCreateInputBatchesInnerAllOf(self): - """Test InstancesBatchCreateInputBatchesInnerAllOf""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/equinix/services/metalv1/test/test_interconnection.py b/equinix/services/metalv1/test/test_interconnection.py index 78d6fe6f..8e2d8a92 100644 --- a/equinix/services/metalv1/test/test_interconnection.py +++ b/equinix/services/metalv1/test/test_interconnection.py @@ -62,7 +62,12 @@ def make_instance(self, include_optional) -> Interconnection: name = '', ), href = '', id = '', - metro = None, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), mode = 'standard', name = '', organization = equinix.services.metalv1.models.organization.Organization( diff --git a/equinix/services/metalv1/test/test_interconnection_metro.py b/equinix/services/metalv1/test/test_interconnection_metro.py deleted file mode 100644 index c750e50a..00000000 --- a/equinix/services/metalv1/test/test_interconnection_metro.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from equinix.services.metalv1.models.interconnection_metro import InterconnectionMetro - -class TestInterconnectionMetro(unittest.TestCase): - """InterconnectionMetro unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> InterconnectionMetro: - """Test InterconnectionMetro - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InterconnectionMetro` - """ - model = InterconnectionMetro() - if include_optional: - return InterconnectionMetro( - code = '', - country = '', - href = '', - id = '', - name = '' - ) - else: - return InterconnectionMetro( - ) - """ - - def testInterconnectionMetro(self): - """Test InterconnectionMetro""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner_all_of.py b/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner_all_of.py deleted file mode 100644 index 644fe479..00000000 --- a/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner_all_of.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - Metal API - - # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. - - The version of the OpenAPI document: 1.0.0 - Contact: support@equinixmetal.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of import InterconnectionMetroListMetrosInnerAllOf - -class TestInterconnectionMetroListMetrosInnerAllOf(unittest.TestCase): - """InterconnectionMetroListMetrosInnerAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> InterconnectionMetroListMetrosInnerAllOf: - """Test InterconnectionMetroListMetrosInnerAllOf - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InterconnectionMetroListMetrosInnerAllOf` - """ - model = InterconnectionMetroListMetrosInnerAllOf() - if include_optional: - return InterconnectionMetroListMetrosInnerAllOf( - href = '', - providers = [ - equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of_providers_inner.InterconnectionMetroList_metros_inner_allOf_providers_inner( - bandwidths = [ - 50 - ], - features = [ - 'high capacity' - ], - href = '', - locations = [ - 'us-east-1' - ], - name = 'AWS Direct Connect', - type = 'CSP_AWS', ) - ] - ) - else: - return InterconnectionMetroListMetrosInnerAllOf( - ) - """ - - def testInterconnectionMetroListMetrosInnerAllOf(self): - """Test InterconnectionMetroListMetrosInnerAllOf""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/equinix/services/metalv1_README.md b/equinix/services/metalv1_README.md index 13da5efd..03c2f3eb 100644 --- a/equinix/services/metalv1_README.md +++ b/equinix/services/metalv1_README.md @@ -397,14 +397,11 @@ Class | Method | HTTP request | Description - [IPReservationRequestInput](equinix/services/metalv1/docs/IPReservationRequestInput.md) - [InstancesBatchCreateInput](equinix/services/metalv1/docs/InstancesBatchCreateInput.md) - [InstancesBatchCreateInputBatchesInner](equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md) - - [InstancesBatchCreateInputBatchesInnerAllOf](equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInnerAllOf.md) - [Interconnection](equinix/services/metalv1/docs/Interconnection.md) - [InterconnectionFabricProvider](equinix/services/metalv1/docs/InterconnectionFabricProvider.md) - [InterconnectionList](equinix/services/metalv1/docs/InterconnectionList.md) - - [InterconnectionMetro](equinix/services/metalv1/docs/InterconnectionMetro.md) - [InterconnectionMetroList](equinix/services/metalv1/docs/InterconnectionMetroList.md) - [InterconnectionMetroListMetrosInner](equinix/services/metalv1/docs/InterconnectionMetroListMetrosInner.md) - - [InterconnectionMetroListMetrosInnerAllOf](equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOf.md) - [InterconnectionMetroListMetrosInnerAllOfProvidersInner](equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOfProvidersInner.md) - [InterconnectionPort](equinix/services/metalv1/docs/InterconnectionPort.md) - [InterconnectionPortList](equinix/services/metalv1/docs/InterconnectionPortList.md)